EditeurPanovisu 3.1.0
Éditeur de visites virtuelles 360° Panovisu
Chargement...
Recherche...
Aucune correspondance
EditeurPanovisu.java
Aller à la documentation de ce fichier.
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6package editeurpanovisu;
7
8import com.drew.imaging.ImageMetadataReader;
9import com.drew.imaging.ImageProcessingException;
10import com.drew.metadata.Directory;
11import com.drew.metadata.Metadata;
19import java.awt.MouseInfo;
20import java.awt.Point;
21import java.io.BufferedReader;
22import java.io.BufferedWriter;
23import java.io.File;
24import java.io.FileInputStream;
25import java.io.FileNotFoundException;
26import java.io.FileOutputStream;
27import java.io.IOException;
28import java.io.InputStreamReader;
29import java.io.OutputStreamWriter;
30import java.io.UnsupportedEncodingException;
31import java.math.BigDecimal;
32import java.net.MalformedURLException;
33import java.net.URI;
34import java.net.URISyntaxException;
35import java.net.URL;
36import java.net.URLConnection;
37import java.nio.file.Files;
38import java.nio.file.StandardCopyOption;
39import java.util.zip.ZipEntry;
40import java.util.zip.ZipOutputStream;
41import java.util.ArrayList;
42import java.util.Arrays;
43import java.util.List;
44import java.util.Locale;
45import java.util.Optional;
46import java.util.Properties;
47import java.util.ResourceBundle;
48import java.util.logging.Level;
49import java.util.logging.Logger;
50import javafx.animation.KeyFrame;
51import javafx.animation.Timeline;
52import javafx.application.Application;
53import javafx.application.Platform;
54import javafx.beans.property.DoubleProperty;
55import javafx.beans.property.SimpleDoubleProperty;
56import javafx.beans.value.ObservableValue;
57import javafx.collections.FXCollections;
58import javafx.collections.ObservableList;
59import javafx.concurrent.Task;
60import javafx.event.ActionEvent;
61import javafx.geometry.Insets;
62import javafx.geometry.Orientation;
63import javafx.geometry.Pos;
64import javafx.geometry.Rectangle2D;
65import javafx.geometry.Side;
66import javafx.scene.Cursor;
67import javafx.scene.Node;
68import javafx.scene.Scene;
69import javafx.scene.control.Alert;
70import javafx.scene.control.Alert.AlertType;
71import javafx.scene.control.Button;
72import javafx.scene.control.ButtonType;
73import javafx.scene.control.CheckBox;
74import javafx.scene.control.ChoiceDialog;
75import javafx.scene.control.ColorPicker;
76import javafx.scene.control.ComboBox;
77import javafx.scene.control.Label;
78import javafx.scene.control.ListView;
79import javafx.scene.control.Menu;
80import javafx.scene.control.MenuBar;
81import javafx.scene.control.MenuButton;
82import javafx.scene.control.MenuItem;
83import javafx.scene.control.ProgressBar;
84import javafx.scene.control.RadioButton;
85import javafx.scene.control.ScrollPane;
86import javafx.scene.control.Separator;
87import javafx.scene.control.SeparatorMenuItem;
88import javafx.scene.control.Slider;
89import javafx.scene.control.Tab;
90import javafx.scene.control.TabPane;
91import javafx.scene.control.TextArea;
92import javafx.scene.control.TextField;
93import javafx.scene.control.TextInputDialog;
94import javafx.scene.control.Toggle;
95import javafx.scene.control.ToggleButton;
96import javafx.scene.control.ToggleGroup;
97import javafx.scene.control.ToolBar;
98import javafx.scene.control.Tooltip;
99import javafx.scene.image.Image;
100import javafx.scene.image.ImageView;
101import javafx.scene.image.PixelReader;
102import javafx.scene.image.PixelWriter;
103import javafx.scene.image.WritableImage;
104import javafx.scene.input.DragEvent;
105import javafx.scene.input.Dragboard;
106import javafx.scene.input.KeyCode;
107import javafx.scene.input.KeyCodeCombination;
108import javafx.scene.input.KeyCombination;
109import javafx.scene.input.MouseButton;
110import javafx.scene.input.MouseEvent;
111import javafx.scene.input.TransferMode;
112import javafx.scene.layout.AnchorPane;
113import javafx.scene.layout.Background;
114import javafx.scene.layout.BackgroundFill;
115import javafx.scene.layout.CornerRadii;
116import javafx.scene.layout.FlowPane;
117import javafx.scene.layout.HBox;
118import javafx.scene.layout.Pane;
119import javafx.scene.layout.StackPane;
120import javafx.scene.layout.VBox;
121import javafx.scene.paint.Color;
122import javafx.scene.shape.Circle;
123import javafx.scene.shape.Line;
124import javafx.scene.shape.Polygon;
125import javafx.scene.shape.Rectangle;
126import javafx.scene.shape.StrokeLineCap;
127import javafx.scene.shape.StrokeLineJoin;
128import javafx.scene.shape.StrokeType;
129import javafx.scene.text.Font;
130import javafx.scene.text.TextAlignment;
131import javafx.scene.web.WebEngine;
132import javafx.scene.web.WebView;
133import javafx.stage.DirectoryChooser;
134import javafx.stage.FileChooser;
135import javafx.stage.Modality;
136import javafx.stage.Screen;
137import javafx.stage.Stage;
138import javafx.stage.WindowEvent;
139import javafx.util.Duration;
140import org.apache.commons.imaging.ImagingException;
141
164public class EditeurPanovisu extends Application {
165
175 private static boolean netIsAvailable() {
176 try {
177 final URL url = new URI("http://www.google.com").toURL();
178 final URLConnection conn = url.openConnection();
179 conn.connect();
180 return true;
182 throw new RuntimeException(e);
183 } catch (IOException e) {
184 return false;
185 }
186 }
187
193 public static String getStrStyleCSS() {
194 return strStyleCSS;
195 }
196
202 public static void setStrStyleCSS(String aStrStyleCSS) {
204 // Vider le cache des icônes SVG lors du changement de thème
206 // Recharger toutes les icônes avec les nouvelles couleurs
208 }
209
217 }
218
224 public static String[] getStrLanguesTraduction() {
226 }
227
233 public static String getStrCurrentDir() {
234 return strCurrentDir;
235 }
236
245
251 public static Locale getLocale() {
252 return locale;
253 }
254
260 public static void setLocale(Locale aLocale) {
261 locale = aLocale;
262 }
263
269 public static int getiNumHTML() {
270 return iNumHTML;
271 }
272
278 public static void setiNumHTML(int aiNumHTML) {
280 }
281
288 return panoramiquesProjet;
289 }
290
299
305 public static Plan[] getPlans() {
306 return plans;
307 }
308
314 public static void setPlans(Plan[] aPlans) {
315 plans = aPlans;
316 }
317
323 public static int getiNombrePanoramiques() {
324 return iNombrePanoramiques;
325 }
326
335
341 public static int getiNombrePanoramiquesFichier() {
343 }
344
353
359 public static int getiNombrePlans() {
360 return iNombrePlans;
361 }
362
368 public static void setiNombrePlans(int aiNombrePlans) {
370 }
371
377 public static int getiPanoActuel() {
378 return iPanoActuel;
379 }
380
386 public static void setiPanoActuel(int aiPanoActuel) {
388 }
389
397 }
398
407
413 public static Tab getTabPlan() {
414 return tabPlan;
415 }
416
422 public static void setTabPlan(Tab aTabPlan) {
424 }
425
433 }
434
443
448 public static Boolean isMac() {
449 if (getStrSystemeExploitation().contains("Mac")) {
450 setiDecalageMac(-30);
451 }
452 return getStrSystemeExploitation().contains("Mac");
453 }
454
459 public static Boolean isLinux() {
460 return getStrSystemeExploitation().contains("Linux");
461 }
462
467 public static Boolean isWindows() {
468 return getStrSystemeExploitation().contains("Windows");
469 }
470
476 public static String getStrTooltipStyle() {
477 return strTooltipStyle;
478 }
479
485 public static String getStrRepertAppli() {
486 return strRepertAppli;
487 }
488
497
516 SvgIconLoader.setBaseAppPath(getStrRepertAppli());
517 return SvgIconLoader.loadSvgIcon(iconName, size);
518 }
519
538 public static ImageView loadSvgIcon(String iconName, int size, javafx.scene.paint.Color color) {
539 SvgIconLoader.setBaseAppPath(getStrRepertAppli());
540 return SvgIconLoader.loadSvgIcon(iconName, size, color);
541 }
542
562 public static ImageView loadSvgIcon(String iconName, int width, int height, javafx.scene.paint.Color color) {
563 SvgIconLoader.setBaseAppPath(getStrRepertAppli());
564 return SvgIconLoader.loadSvgIcon(iconName, width, height, color);
565 }
566
578 private static void rechargerIcones() {
579 if (ivNouveauProjet != null) {
580 ivNouveauProjet.setImage(loadSvgIcon("nouveau-projet", 32).getImage());
581 }
582 if (ivChargeProjet != null) {
583 ivChargeProjet.setImage(loadSvgIcon("ouvrir-projet", 32).getImage());
584 }
585 if (ivSauveProjet != null) {
586 ivSauveProjet.setImage(loadSvgIcon("sauve-projet", 32).getImage());
587 }
588 if (ivAjouterPano != null) {
589 ivAjouterPano.setImage(loadSvgIcon("ajoute-panoramique", 32).getImage());
590 }
591 if (getIvAjouterPlan() != null) {
592 getIvAjouterPlan().setImage(loadSvgIcon("ajoute-plan", 32).getImage());
593 }
594 if (ivVisiteGenere != null) {
595 ivVisiteGenere.setImage(loadSvgIcon("genere-visite", 32).getImage());
596 }
597 if (ivGenereZip != null) {
598 ivGenereZip.setImage(loadSvgIcon("genere-zip", 35).getImage());
599 }
600 if (ivEqui2Cube != null) {
601 ivEqui2Cube.setImage(loadSvgIcon("vue-sphere", 128, 64, null).getImage());
602 }
603 if (ivCube2Equi != null) {
604 ivCube2Equi.setImage(loadSvgIcon("vue-cube", 128, 64, null).getImage());
605 }
606 if (ivRedimensionnerImages != null) {
607 ivRedimensionnerImages.setImage(loadSvgIcon("redimensionner-images", 95, 48, null).getImage());
608 }
609 if (ivConvertirRatio2to1 != null) {
610 ivConvertirRatio2to1.setImage(loadSvgIcon("ratio-2to1", 128, 72, null).getImage());
611 }
612 }
613
619 public static String getStrRepertTemp() {
620 return strRepertTemp;
621 }
622
631
637 public static String getStrRepertPanos() {
638 return strRepertPanos;
639 }
640
649
655 public static String getStrRepertHSImages() {
656 return strRepertHSImages;
657 }
658
667
674 return strRepertoireProjet;
675 }
676
685
694
703
712
721
727 public static boolean isbDejaSauve() {
728 return bDejaSauve;
729 }
730
736 public static void setbDejaSauve(boolean abDejaSauve) {
738 }
739
745 public static Stage getStPrincipal() {
746 return stPrincipal;
747 }
748
754 public static void setStPrincipal(Stage aStPrincipal) {
756 }
757
766
775
784
793
799 public static MenuItem getMniAjouterPlan() {
800 return mniAjouterPlan;
801 }
802
811
818 return mniAffichagePlan;
819 }
820
829
835 public static ImageView getIvAjouterPlan() {
836 return ivAjouterPlan;
837 }
838
847
853 public static Tab getTabInterface() {
854 return tabInterface;
855 }
856
862 public static void setTabInterface(Tab aTabInterface) {
864 }
865
871 public static AnchorPane getApAttends() {
872 return apAttends;
873 }
874
880 public static void setApAttends(AnchorPane apAttends1) {
882 }
883
889 public static String getStrBingAPIKey() {
890 return strBingAPIKey;
891 }
892
899
905 public static boolean isbAutoRotationDemarre() {
907 }
908
917
923 public static int getiAutoRotationVitesse() {
925 }
926
935
941 public static boolean isbAutoTourDemarre() {
942 return bAutoTourDemarre;
943 }
944
953
959 public static int getiAutoTourLimite() {
960 return iAutoTourLimite;
961 }
962
971
977 public static String getStrAutoTourType() {
978 return strAutoTourType;
979 }
980
989
995 public static boolean isbPetitePlaneteDemarrage() {
997 }
998
1007
1013 public static boolean isbIntroPetitePlanete() {
1014 return bIntroPetitePlanete;
1015 }
1016
1025
1032 return poGeolocalisation;
1033 }
1034
1043
1049 public static boolean isbInternet() {
1050 return bInternet;
1051 }
1052
1058 public static void setbInternet(boolean abInternet) {
1060 }
1061
1067 public static int getiDecalageMac() {
1068 return iDecalageMac;
1069 }
1070
1076 public static void setiDecalageMac(int aiDecalageMac) {
1078 }
1079
1085 public static VBox getVbChoixPanoramique() {
1086 return vbChoixPanoramique;
1087 }
1088
1097
1103 public static AnchorPane getApPVIS() {
1104 return apPVIS;
1105 }
1106
1112 public static void setApPVIS(AnchorPane aApPVIS) {
1113 apPVIS = aApPVIS;
1114 }
1115
1121 public static AnchorPane getApAR() {
1122 return apAR;
1123 }
1124
1130 public static void setApAR(AnchorPane aApAR) {
1131 apAR = aApAR;
1132 }
1133
1139 public static AnchorPane getApPPAN() {
1140 return apPPAN;
1141 }
1142
1148 public static void setApPPAN(AnchorPane aApPPAN) {
1149 apPPAN = aApPPAN;
1150 }
1151
1157 public static AnchorPane getApDESCIA() {
1158 return apDESCIA;
1159 }
1160
1166 public static void setApDESCIA(AnchorPane aApDESCIA) {
1168 }
1169
1175 public static AnchorPane getApGEO() {
1176 return apGEO;
1177 }
1178
1184 public static void setApGEO(AnchorPane aApGEO) {
1185 apGEO = aApGEO;
1186 }
1187
1193 public static AnchorPane getApVISU() {
1194 return apVISU;
1195 }
1196
1202 public static void setApVISU(AnchorPane aApVISU) {
1203 apVISU = aApVISU;
1204 }
1205
1211 public static AnchorPane getApHS() {
1212 return apHS;
1213 }
1214
1220 public static void setApHS(AnchorPane aApHS) {
1221 apHS = aApHS;
1222 }
1223
1229 public static int getiAutoTourDemarrage() {
1230 return iAutoTourDemarrage;
1231 }
1232
1241
1247 public static Scene getScnPrincipale() {
1248 return scnPrincipale;
1249 }
1250
1259
1265 public static int getiNumDiapo() {
1266 return iNumDiapo;
1267 }
1268
1274 public static void setiNumDiapo(int aiNumDiapo) {
1276 }
1277
1283 public static int getiNumImages() {
1284 return iNumImages;
1285 }
1286
1292 public static void setiNumImages(int aiNumImages) {
1294 }
1295
1301 public static int getiNumPoints() {
1302 return iNumPoints;
1303 }
1304
1310 public static void setiNumPoints(int aiNumPoints) {
1312 }
1313
1319 public static int getiNombreDiapo() {
1320 return iNombreDiapo;
1321 }
1322
1328 public static void setiNombreDiapo(int aiNombreDiapo) {
1330 }
1331
1337 public static boolean isAfficheLoupe() {
1338 return afficheLoupe;
1339 }
1340
1346 public static void setAfficheLoupe(boolean aAfficheLoupe) {
1348 }
1349
1355 public static int getiTailleLoupe() {
1356 return iTailleLoupe;
1357 }
1358
1364 public static void setiTailleLoupe(int aiTailleLoupe) {
1367 } else if (aiTailleLoupe > iTailleLoupeMax) {
1369 } else {
1371 }
1372 }
1373
1380 return strTypeFichierTransf;
1381 }
1382
1391
1397 public static double getLargeurE2C() {
1398 return largeurE2C;
1399 }
1400
1406 public static void setLargeurE2C(double aLargeurE2C) {
1408 }
1409
1415 public static double getHauteurE2C() {
1416 return hauteurE2C;
1417 }
1418
1424 public static void setHauteurE2C(double aHauteurE2C) {
1426 }
1427
1433 public static boolean isbNetteteTransf() {
1434 return bNetteteTransf;
1435 }
1436
1442 public static void setbNetteteTransf(boolean abNetteteTransf) {
1444 }
1445
1451 public static double getNiveauNetteteTransf() {
1452 return niveauNetteteTransf;
1453 }
1454
1463
1468 private static class AncreForme extends Circle {
1469
1470 @SuppressWarnings("unused")
1472
1480 super(dpX.get(), dpY.get(), 2);
1481 setFill(color.deriveColor(1, 1, 1, 0.5));
1483 setStrokeWidth(2);
1484 setStrokeType(StrokeType.OUTSIDE);
1485 setCursor(Cursor.HAND);
1486
1487 this.dpX = dpX;
1488 this.dpY = dpY;
1489
1490 dpX.bind(centerXProperty());
1491 dpY.bind(centerYProperty());
1492 enableDrag();
1493 }
1494
1498 @SuppressWarnings("unused")
1500 final Delta dragDelta = new Delta();
1501
1503 dragDelta.x = getCenterX() - mouseEvent.getX();
1504 dragDelta.y = getCenterY() - mouseEvent.getY();
1505 getScene().setCursor(Cursor.MOVE);
1506 });
1507
1509 getScene().setCursor(Cursor.HAND);
1510 });
1511
1513 double newX = mouseEvent.getX() + dragDelta.x;
1514 if (newX > 0 && newX < getScene().getWidth()) {
1516 }
1517 double newY = mouseEvent.getY() + dragDelta.y;
1518 if (newY > 0 && newY < getScene().getHeight()) {
1520 }
1521 });
1522
1524 if (!mouseEvent.isPrimaryButtonDown()) {
1525 getScene().setCursor(Cursor.HAND);
1526 }
1527 });
1528
1530 if (!mouseEvent.isPrimaryButtonDown()) {
1531 getScene().setCursor(Cursor.DEFAULT);
1532 }
1533 });
1534 }
1535
1539 private class Delta {
1540
1541 double x, y;
1542 }
1543 }
1544
1545 private static VBox vbRacine;
1546 private static AnchorPane apPanovisu;
1547 final public static double largeurOutils = 380d;
1548 private static final ImageView ivLoupe = new ImageView();
1549 private static final AnchorPane apLoupe = new AnchorPane();
1550 private static int iTailleLoupe = 140;
1551 private static final int iTailleLoupeMin = 100;
1552 private static final int iTailleLoupeMax = 200;
1553 private static String strPositLoupe = "gauche";
1554 private static boolean afficheLoupe;
1555 private static double positLoupeX;
1556 private static double positLoupeY;
1557 private static String strTypeFichierTransf = "jpg";
1558 private static double largeurE2C = 650;
1559 private static double hauteurE2C = 420;
1560 private static boolean bNetteteTransf = false;
1561 private static double niveauNetteteTransf = 0.2;
1562 private static int iNumeroPanoChoisitHS;
1564 private static int iDecalageMac = 0;
1569 private static Slider slMinLat;
1570 private static Slider slMaxLat;
1571 private static Slider slMinFov;
1572 private static Slider slMaxFov;
1573 private static CheckBox cbMinLat;
1574 private static CheckBox cbMaxLat;
1575 private static Line ligNadir;
1576 private static Line ligZenith;
1577 public static Diaporama[] diaporamas = new Diaporama[100];
1578 private static int iNombreDiapo = 0;
1581
1582 @SuppressWarnings("rawtypes")
1584
1596
1597 // ====================================================================
1598 // CONFIGURATION ET INTERNATIONALISATION
1599 // ====================================================================
1600
1614
1621 private static final String[] strCodesLanguesTraduction = {"fr_FR", "en_EN", "de_DE", "pt_BR"};
1622
1628 private static final String[] strLanguesTraduction = {"Français", "English", "Deutsch", "Português"};
1629
1635 private static String strCurrentDir = "";
1636
1645 private static Locale locale = new Locale("fr", "FR");
1646
1654 private static Label lblDragDrop;
1657 private static AnchorPane apVisuPano;
1658 private static Image imgPanoRetaille2;
1659 static private Label lblLong, lblLat;
1664 final static private int iLargeurVignettes = 180;
1665 static private HBox hbCoordonnees;
1666 static private int iNumPoints = 0;
1667 static private int iNumImages = 0;
1668 static private boolean dejaCharge = false;
1669 // ====================================================================
1670 // DONNÉES DU PROJET
1671 // ====================================================================
1672
1679 private static int iNumHTML = 0;
1680
1686 private static int iNumDiapo = 0;
1687
1697 private static Panoramique[] panoramiquesProjet = new Panoramique[100];
1698
1707 private static Plan[] plans = new Plan[20];
1708
1715 private static int iNombrePanoramiques = 0;
1716
1722 private static int iNombrePanoramiquesFichier = 0;
1724 static public MenuBar mbarPrincipal = new MenuBar();
1725 static public ToolBar bbarPrincipal = new ToolBar();
1726 static public HBox hbBarreBouton;
1727 static public VBox vbMonPanneau; // Panneau contenant le menu et la barre d'outils
1730 private static int iNombrePlans = 0;
1731 private static int iPanoActuel = 0;
1732 static private File fileProjet;
1733 private static String strPanoListeVignette = "";
1734 static private Pane panePanoramique;
1735 private static VBox vbChoixPanoramique;
1736 static private VBox vbOutils;
1737 static private Tab tabVisite;
1738 static private AnchorPane apAttends;
1739 static private Label lblCharge;
1740 static private Label lblNiveaux;
1741 static private Tab tabInterface;
1742 private static Tab tabPlan;
1743 private static Scene scnPrincipale;
1744 private static final AnchorPane apWebview = new AnchorPane();
1747 static private double largeurMax;
1748 static private boolean bEstCharge = false;
1749 static private boolean bRepertSauveChoisi = false;
1750 static private String strPanoEntree = "";
1751 private static String strSystemeExploitation = "";
1752 private static final String strTooltipStyle = "";
1753 static private boolean bDragDrop = false;
1754 static private String strTitreVisite = "";
1755 private static final AnchorPane apVisuPanoramique = new AnchorPane();
1758 private static String strBingAPIKey = "";
1759 private static VBox vbVisuHotspots;
1760 private static AnchorPane apVisuHS;
1761 private static boolean bInternet;
1762 private static AnchorPane apOpenLayers;
1763 private static PaneOutil apHS1;
1764 /*
1765 Panel Creation Barre Navigation
1766 */
1771 private static Button btnAjouteZone;
1773 private static boolean bRecommenceZone = false;
1774 static private int iNombreZones;
1775 private static int iNombrePointsZone;
1776 private static double x1Zone, y1Zone;
1778 private static String strTypeZone = "";
1779 private static String strNomFichierShp = "";
1780 private static final ZoneTelecommande[] zones = new ZoneTelecommande[25];
1781 private static final double[] pointsPolyZone = new double[200];
1782 @SuppressWarnings("unused")
1785 "Haut/Up", "Droite/Right", "Bas/Down", "Gauche/Left",
1786 "Zoom +", "Zoom -", "Info", "Aide/Help",
1787 "Rotation", "mode Souris/Mouse", "Plein Ecran/Fullscreen",
1788 "Lien/Link 1", "Lien/Link 2",
1789 "zone 1", "zone 2", "zone 3", "zone 4", "zone 5",
1790 "zone 6", "zone 7", "zone 8", "zone 9", "zone 10"
1791 };
1792 private static final String[] strCodeBarre = {
1793 "telUp", "telRight", "telDown", "telLeft",
1794 "telZoomPlus", "telZoomMoins", "telInfo", "telAide",
1795 "telRotation", "telSouris", "telFS",
1796 "telLien-1", "telLien-2",
1797 "area-1", "area-2", "area-3", "area-4", "area-5",
1798 "area-6", "area-7", "area-8", "area-9", "area-10"
1799 };
1800
1801 // ====================================================================
1802 // RÉPERTOIRES ET CHEMINS
1803 // ====================================================================
1804
1814 private static String strRepertAppli = "";
1815
1825 private static String strRepertTemp = "";
1826
1835 static private String strRepertPanos = "";
1836
1845 static private String strRepertHSImages = "";
1846
1856 private static String strRepertoireProjet = "";
1857
1869
1881
1888 static public File fileRepertConfig;
1889
1890 @SuppressWarnings("rawtypes")
1909
1913
1932 // Supprimé : private static MenuItem mniAide; (option redondante)
1934
1939
1941
1946
1950
1956
1962
1972
1978
1984
1988
2017
2043
2044 private static void genereVisite(boolean isZip) throws IOException {
2045 if (!bRepertSauveChoisi) {
2047 }
2048 if (!isbDejaSauve()) {
2049 projetSauve();
2050 }
2051 if (isbDejaSauve()) {
2052 String strHTMLRepert = getStrRepertTemp() + "/pagesHTML";
2054 if (!fileHTMLRepert.exists()) {
2055 fileHTMLRepert.mkdirs();
2056 }
2057
2058 // Sauvegarder les icônes colorées personnalisées avant de supprimer le répertoire images
2059 // Au lieu de chercher les fichiers existants, on va régénérer les icônes colorées
2060 // à partir des hotspots qui ont une couleur personnalisée définie
2061 java.util.Map<String, WritableImage> iconesARegenerer = new java.util.HashMap<>();
2062
2063 System.out.println("🔍 DEBUG - Recherche des hotspots avec couleurs personnalisées...");
2064
2065 for (int iPano = 0; iPano < getiNombrePanoramiques(); iPano++) {
2066 // Hotspots panoramiques
2067 for (int iHS = 0; iHS < getPanoramiquesProjet()[iPano].getNombreHotspots(); iHS++) {
2069 if (hs.getStrCouleurPerso() != null && !hs.getStrCouleurPerso().isEmpty()) {
2071 if (nomFichier != null && !nomFichier.isEmpty()) {
2072 System.out.println("✅ Hotspot pano " + iPano + "." + iHS + " a une couleur : " + nomFichier);
2073 // Parser la couleur HSB depuis la chaîne "hue;saturation;brightness"
2074 String[] couleurParts = hs.getStrCouleurPerso().split(";");
2075 if (couleurParts.length == 3) {
2076 double hue = Double.parseDouble(couleurParts[0]);
2077 double saturation = Double.parseDouble(couleurParts[1]);
2078 double brightness = Double.parseDouble(couleurParts[2]);
2079
2080 // Utiliser l'image source stockée dans le hotspot si elle existe
2081 Image imgSource = hs.getImgIconeSource();
2082 if (imgSource == null) {
2083 // Fallback sur l'image globale si pas d'image personnalisée
2085 System.out.println("⚠️ Hotspot pano " + iPano + "." + iHS + " : utilisation image globale (pas d'image personnalisée)");
2086 } else {
2087 System.out.println("✅ Hotspot pano " + iPano + "." + iHS + " : utilisation image personnalisée");
2088 }
2089
2091 if (imgColoree != null) {
2093 }
2094 }
2095 }
2096 }
2097 }
2098
2099 // Hotspots images
2100 for (int iHS = 0; iHS < getPanoramiquesProjet()[iPano].getNombreHotspotImage(); iHS++) {
2102 if (hs.getStrCouleurPerso() != null && !hs.getStrCouleurPerso().isEmpty()) {
2104 if (nomFichier != null && !nomFichier.isEmpty()) {
2105 System.out.println("✅ Hotspot image " + iPano + "." + iHS + " a une couleur : " + nomFichier);
2106 // Parser la couleur HSB depuis la chaîne "hue;saturation;brightness"
2107 String[] couleurParts = hs.getStrCouleurPerso().split(";");
2108 if (couleurParts.length == 3) {
2109 double hue = Double.parseDouble(couleurParts[0]);
2110 double saturation = Double.parseDouble(couleurParts[1]);
2111 double brightness = Double.parseDouble(couleurParts[2]);
2112
2113 // Utiliser l'image source stockée dans le hotspot si elle existe
2114 Image imgSource = hs.getImgIconeSource();
2115 if (imgSource == null) {
2116 // Fallback sur l'image globale si pas d'image personnalisée
2118 System.out.println("⚠️ Hotspot image " + iPano + "." + iHS + " : utilisation image globale (pas d'image personnalisée)");
2119 } else {
2120 System.out.println("✅ Hotspot image " + iPano + "." + iHS + " : utilisation image personnalisée");
2121 }
2122
2124 if (imgColoree != null) {
2126 }
2127 }
2128 }
2129 }
2130 }
2131
2132 // Hotspots HTML
2133 for (int iHS = 0; iHS < getPanoramiquesProjet()[iPano].getNombreHotspotHTML(); iHS++) {
2135 if (hs.getStrCouleurPerso() != null && !hs.getStrCouleurPerso().isEmpty()) {
2137 if (nomFichier != null && !nomFichier.isEmpty()) {
2138 System.out.println("✅ Hotspot HTML " + iPano + "." + iHS + " a une couleur : " + nomFichier);
2139 // Parser la couleur HSB depuis la chaîne "hue;saturation;brightness"
2140 String[] couleurParts = hs.getStrCouleurPerso().split(";");
2141 if (couleurParts.length == 3) {
2142 double hue = Double.parseDouble(couleurParts[0]);
2143 double saturation = Double.parseDouble(couleurParts[1]);
2144 double brightness = Double.parseDouble(couleurParts[2]);
2145
2146 // Utiliser l'image source stockée dans le hotspot si elle existe
2147 Image imgSource = hs.getImgIconeSource();
2148 if (imgSource == null) {
2149 // Fallback sur l'image globale si pas d'image personnalisée
2151 System.out.println("⚠️ Hotspot HTML " + iPano + "." + iHS + " : utilisation image globale (pas d'image personnalisée)");
2152 } else {
2153 System.out.println("✅ Hotspot HTML " + iPano + "." + iHS + " : utilisation image personnalisée");
2154 }
2155
2157 if (imgColoree != null) {
2159 }
2160 }
2161 }
2162 }
2163 }
2164 }
2165
2166 System.out.println("🔍 DEBUG - Nombre d'icônes à régénérer : " + iconesARegenerer.size());
2167
2168 deleteDirectory(getStrRepertTemp() + "/panovisu/images");
2169 File fileImagesRepert = new File(getStrRepertTemp() + "/panovisu/images");
2170 if (!fileImagesRepert.exists()) {
2171 fileImagesRepert.mkdirs();
2172 }
2173 File fileBoutonRepert = new File(getStrRepertTemp() + "/panovisu/images/navigation");
2174 if (!fileBoutonRepert.exists()) {
2175 fileBoutonRepert.mkdirs();
2176 }
2177 File fileBoussoleRepert = new File(getStrRepertTemp() + "/panovisu/images/boussoles");
2178 if (!fileBoussoleRepert.exists()) {
2179 fileBoussoleRepert.mkdirs();
2180 }
2181 copieRepertoire(getStrRepertAppli() + File.separator + "panovisu/images/boussoles", fileBoussoleRepert.getAbsolutePath());
2182 File filePlanRepert = new File(getStrRepertTemp() + "/panovisu/images/plan");
2183 if (!filePlanRepert.exists()) {
2184 filePlanRepert.mkdirs();
2185 }
2186 copieRepertoire(getStrRepertAppli() + File.separator + "panovisu/images/plan", filePlanRepert.getAbsolutePath());
2187 File fileReseauRepert = new File(getStrRepertTemp() + "/panovisu/images/reseaux");
2188 if (!fileReseauRepert.exists()) {
2189 fileReseauRepert.mkdirs();
2190 }
2191 copieRepertoire(getStrRepertAppli() + File.separator + "panovisu/images/reseaux", fileReseauRepert.getAbsolutePath());
2192 File fileInterfaceRepert = new File(getStrRepertTemp() + "/panovisu/images/interface");
2193 if (!fileInterfaceRepert.exists()) {
2194 fileInterfaceRepert.mkdirs();
2195 }
2196 copieRepertoire(getStrRepertAppli() + File.separator + "panovisu/images/interface", fileInterfaceRepert.getAbsolutePath());
2197 File fileMARepert = new File(getStrRepertTemp() + "/panovisu/images/MA");
2198 if (!fileMARepert.exists()) {
2199 fileMARepert.mkdirs();
2200 }
2201 File fileHotspotsRepert = new File(getStrRepertTemp() + "/panovisu/images/hotspots");
2202 if (!fileHotspotsRepert.exists()) {
2203 fileHotspotsRepert.mkdirs();
2204 }
2205
2206 System.out.println("🔍 DEBUG - Régénération des icônes dans : " + fileHotspotsRepert.getAbsolutePath());
2207
2208 // Régénérer les icônes colorées personnalisées
2209 int compteurRegenere = 0;
2210 for (java.util.Map.Entry<String, WritableImage> entry : iconesARegenerer.entrySet()) {
2211 try {
2212 String nomFichier = entry.getKey();
2213 WritableImage img = entry.getValue();
2215
2217 System.out.println("✅ Icône colorée régénérée : " + nomFichier);
2219 } catch (IOException ex) {
2220 System.err.println("⚠️ Erreur lors de la régénération de l'icône : " + entry.getKey());
2221 ex.printStackTrace();
2222 }
2223 }
2224
2225 System.out.println("🔍 DEBUG - " + compteurRegenere + " icônes régénérées");
2226
2227 // Vérifier le contenu final du répertoire hotspots
2228 File[] fichiersFinal = fileHotspotsRepert.listFiles();
2229 System.out.println("🔍 DEBUG - Fichiers dans hotspots après régénération : " + (fichiersFinal != null ? fichiersFinal.length : 0));
2230 if (fichiersFinal != null) {
2231 for (File f : fichiersFinal) {
2232 System.out.println(" - " + f.getName());
2233 }
2234 }
2235
2237 File fileTelecommandeRepert = new File(getStrRepertTemp() + "/panovisu/images/telecommande");
2238 if (!fileTelecommandeRepert.exists()) {
2239 fileTelecommandeRepert.mkdirs();
2240 }
2242 if (barrePersonnalisee != null) {
2244 getStrRepertTemp() + "/panovisu/images/telecommande" + File.separator + "telecommande.png",
2245 false, 0.f);
2246 } else {
2247 System.err.println("⚠️ Barre personnalisée null - fichier telecommande.png non généré");
2248 }
2249 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "fs.png",
2250 getStrRepertTemp() + "/panovisu/images/telecommande");
2251 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "fs2.png",
2252 getStrRepertTemp() + "/panovisu/images/telecommande");
2253 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "souris.png",
2254 getStrRepertTemp() + "/panovisu/images/telecommande");
2255 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "souris2.png",
2256 getStrRepertTemp() + "/panovisu/images/telecommande");
2257 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "aide.png",
2258 getStrRepertTemp() + "/panovisu/images/telecommande");
2259 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "info.png",
2260 getStrRepertTemp() + "/panovisu/images/telecommande");
2261 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "rotation.png",
2262 getStrRepertTemp() + "/panovisu/images/telecommande");
2263 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "zoomin.png",
2264 getStrRepertTemp() + "/panovisu/images/telecommande");
2265 copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "zoomout.png",
2266 getStrRepertTemp() + "/panovisu/images/telecommande");
2267 }
2268 copieFichierRepertoire(getStrRepertAppli() + "/theme" + File.separator + "chargement.gif",
2269 getStrRepertTemp() + "/panovisu/images");
2270 copieFichierRepertoire(getStrRepertAppli() + File.separator + "panovisu" + File.separator + "images" + File.separator + "aide_souris.png",
2271 getStrRepertTemp() + "/panovisu/images");
2272 copieFichierRepertoire(getStrRepertAppli() + File.separator + "panovisu" + File.separator + "images" + File.separator + "fermer.png",
2273 getStrRepertTemp() + "/panovisu/images");
2274 copieFichierRepertoire(getStrRepertAppli() + File.separator + "panovisu" + File.separator + "images" + File.separator + "precedent.png",
2275 getStrRepertTemp() + "/panovisu/images");
2276 copieFichierRepertoire(getStrRepertAppli() + File.separator + "panovisu" + File.separator + "images" + File.separator + "suivant.png",
2277 getStrRepertTemp() + "/panovisu/images");
2278 for (int i = 0; i < getGestionnaireInterface().getiNombreImagesBouton() - 2; i++) {
2281 false, 0.f);
2282 }
2283 if (!strTypeHS.equals("gif")) {
2285 fileHotspotsRepert.getAbsolutePath() + File.separator + "hotspot.png",
2286 false, 0.f);
2287 } else {
2288 copieFichierRepertoire(getStrRepertAppli() + "/theme/hotspots" + File.separator + strNomfichierHS, fileHotspotsRepert.getAbsolutePath() + File.separator);
2289 }
2290
2291 if (!strTypeHSImage.equals("gif")) {
2292 ReadWriteImage.writePng(getGestionnaireInterface().getWiNouveauxBoutons()[getGestionnaireInterface().getiNombreImagesBouton() - 1],
2293 fileHotspotsRepert.getAbsolutePath() + File.separator + "hotspotImage.png",
2294 false, 0.f);
2295 } else {
2296 copieFichierRepertoire(getStrRepertAppli() + "/theme/photos" + File.separator + strNomfichierHSImage, fileHotspotsRepert.getAbsolutePath() + File.separator);
2297 }
2298 if (!strTypeHSHTML.equals("gif")) {
2299 ReadWriteImage.writePng(getGestionnaireInterface().getWiNouveauxBoutons()[getGestionnaireInterface().getiNombreImagesBouton()],
2300 fileHotspotsRepert.getAbsolutePath() + File.separator + "hotspotHTML.png",
2301 false, 0.f);
2302 } else {
2303 copieFichierRepertoire(getStrRepertAppli() + "/theme/html" + File.separator + strNomfichierHSHTML, fileHotspotsRepert.getAbsolutePath() + File.separator);
2304 }
2305
2306 // Note : Les icônes colorées personnalisées sont déjà créées dans temp/panovisu/images/hotspots
2307 // par la méthode sauvegardeIconeHotspot() lors de la modification des hotspots
2308
2309 ReadWriteImage.writePng(getGestionnaireInterface().getWiNouveauxMasque(),
2310 fileMARepert.getAbsolutePath() + File.separator + "MA.png",
2311 false, 0.f);
2312
2313 if (getGestionnaireInterface().isbAfficheCarte()) {
2314 File filemarqueursOL = new File(getStrRepertTemp() + "/panovisu/images/marqueursOL");
2315 if (!filemarqueursOL.exists()) {
2316 filemarqueursOL.mkdirs();
2317 }
2318 copieFichierRepertoire(getStrRepertAppli() + File.separator + "theme" + File.separator + "marqueursOL" + File.separator + "marqueur.png", getStrRepertTemp() + File.separator + "panovisu/images/marqueursOL");
2319 copieFichierRepertoire(getStrRepertAppli() + File.separator + "theme" + File.separator + "marqueursOL" + File.separator + "home.png", getStrRepertTemp() + File.separator + "panovisu/images/marqueursOL");
2320 copieFichierRepertoire(getStrRepertAppli() + File.separator + "theme" + File.separator + "marqueursOL" + File.separator + "marqueurActif.png", getStrRepertTemp() + File.separator + "panovisu/images/marqueursOL");
2321 }
2322 if (getGestionnaireInterface().isbAfficheBoutonVisiteAuto()) {
2323 File filemarqueursAT = new File(getStrRepertTemp() + "/panovisu/images/visiteAutomatique");
2324 if (!filemarqueursAT.exists()) {
2325 filemarqueursAT.mkdirs();
2326 }
2327 copieFichierRepertoire(getStrRepertAppli() + File.separator + "theme" + File.separator + "visiteAutomatique" + File.separator + "playAutoTour.png", getStrRepertTemp() + File.separator + "panovisu/images/visiteAutomatique");
2328 copieFichierRepertoire(getStrRepertAppli() + File.separator + "theme" + File.separator + "visiteAutomatique" + File.separator + "pauseAutoTour.png", getStrRepertTemp() + File.separator + "panovisu/images/visiteAutomatique");
2329 }
2330 File fileXMLRepert = new File(getStrRepertTemp() + File.separator + "xml");
2331 if (!fileXMLRepert.exists()) {
2332 fileXMLRepert.mkdirs();
2333 }
2334 File fileCSSRepert = new File(getStrRepertTemp() + File.separator + "css");
2335 if (!fileCSSRepert.exists()) {
2336 fileCSSRepert.mkdirs();
2337 }
2338 File fileJsRepert = new File(getStrRepertTemp() + File.separator + "js");
2339 if (!fileJsRepert.exists()) {
2340 fileJsRepert.mkdirs();
2341 }
2343 File fileXML;
2344 @SuppressWarnings("unused")
2346 int iPanoEntree = Integer.parseInt(ordPano.getStrPanos().get(0));
2348 .substring(getPanoramiquesProjet()[iPanoEntree].getStrNomFichier().lastIndexOf(File.separator) + 1, getPanoramiquesProjet()[iPanoEntree].getStrNomFichier().length())
2349 .split("\\.")[0];
2350 for (int ii = 0; ii < ordPano.getStrPanos().size(); ii++) {
2351 int i = Integer.parseInt(ordPano.getStrPanos().get(ii));
2354 if (!fileHTMLPanoRepert.exists()) {
2355 fileHTMLPanoRepert.mkdirs();
2356 }
2357 String strFichierPano = "panos/panovisu" + i;
2358 if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.CUBE)) {
2359 strChargeImages += " images[" + i + "]=\"" + strFichierPano + "_f.jpg\"\n";
2360 strChargeImages += " images[" + i + "]=\"" + strFichierPano + "_b.jpg\"\n";
2361 strChargeImages += " images[" + i + "]=\"" + strFichierPano + "_u.jpg\"\n";
2362 strChargeImages += " images[" + i + "]=\"" + strFichierPano + "_d.jpg\"\n";
2363 strChargeImages += " images[" + i + "]=\"" + strFichierPano + "_r.jpg\"\n";
2364 strChargeImages += " images[" + i + "]=\"" + strFichierPano + "_l.jpg\"\n";
2365 } else {
2366 strChargeImages += " images[" + i + "]=\"" + strFichierPano + ".jpg\"\n";
2367 }
2369 String strAutorotation = (isbAutoRotationDemarre()) ? "oui" : "non";
2370 String strAutoTour = (isbAutoTourDemarre()) ? "oui" : "non";
2372 String strAffInfo = (getPanoramiquesProjet()[i].isAfficheInfo()) ? "oui" : "non";
2373 @SuppressWarnings("unused")
2375 @SuppressWarnings("unused")
2377 double regX;
2378 double zN;
2379 if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
2380 regX = Math.round(((getPanoramiquesProjet()[i].getRegardX() - 180) % 360) * 10) / 10;
2381 zN = Math.round(((getPanoramiquesProjet()[i].getZeroNord() - 180) % 360) * 10) / 10;
2382 } else {
2383 regX = Math.round(((getPanoramiquesProjet()[i].getRegardX() + 90) % 360) * 10) / 10;
2384 zN = Math.round(((getPanoramiquesProjet()[i].getZeroNord() + 90) % 360) * 10) / 10;
2385 }
2386
2387 Color coulTitre = Color.valueOf(getGestionnaireInterface().getStrCouleurFondTitre());
2388 int iRouge = (int) (coulTitre.getRed() * 255.d);
2389 int iBleu = (int) (coulTitre.getBlue() * 255.d);
2390 int iVert = (int) (coulTitre.getGreen() * 255.d);
2391 String strCoulFondTitre = "rgba(" + iRouge + "," + iVert + "," + iBleu + "," + getGestionnaireInterface().getTitreOpacite() + ")";
2392
2393 strContenuFichier = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2394 + "<!--\n"
2395 + " Visite générée par l'éditeur panoVisu \n"
2396 + "\n"
2397 + " Création L.LANG le monde à  360° : http://lemondea360.fr\n"
2398 + "\n"
2399 + " fichier image : " + getPanoramiquesProjet()[i].getStrNomFichier() + "\n"
2400 + "\n"
2401 + "-->\n"
2402 + "\n"
2403 + "\n"
2404 + "<scene>\n"
2405 + " <pano \n"
2406 + " image=\"" + strFichierPano + "\"\n";
2407 if (getGestionnaireInterface().isbAfficheTitre() && getGestionnaireInterface().isbTitreVisite() && getGestionnaireInterface().isbTitrePanoramique()) {
2408 String strTit = "";
2409 TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
2410 if (!tfVisite.getText().equals("")) {
2411 strTit = tfVisite.getText();
2412 }
2413
2415 += " afftitre=\"oui\"\n"
2416 + " titre=\"" + strTit + "\"\n"
2417 + " titre2=\"" + getPanoramiquesProjet()[i].getStrTitrePanoramique() + "\"\n";
2418 } else if (getGestionnaireInterface().isbAfficheTitre() && getGestionnaireInterface().isbTitreVisite()) {
2419 String strTit = "";
2420 TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
2421 if (!tfVisite.getText().equals("")) {
2422 strTit = tfVisite.getText();
2423 }
2424
2426 += " afftitre=\"oui\"\n"
2427 + " titre=\"" + strTit + "\"\n";
2428
2430 @SuppressWarnings("unused")
2431 String strTit = "";
2432 TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
2433 if (!tfVisite.getText().equals("")) {
2434 strTit = tfVisite.getText();
2435 }
2436
2438 += " afftitre=\"oui\"\n"
2439 + " titre2=\"" + getPanoramiquesProjet()[i].getStrTitrePanoramique() + "\"\n";
2440
2441 } else {
2443 += " afftitre=\"non\"\n";
2444 }
2445 int taillePolice2 = (int) Math.round(Double.parseDouble(getGestionnaireInterface().getStrTitrePoliceTaille()) * 3.d / 4.d);
2447 += " titrePosition=\"" + getGestionnaireInterface().getStrTitrePosition() + "\"\n"
2448 + " titreDecalage=\"" + Math.round(getGestionnaireInterface().getTitreDecalage()) + "px\"\n"
2449 + " titrePolice=\"" + getGestionnaireInterface().getStrTitrePoliceNom() + "\"\n"
2450 + " titreTaillePolice=\"" + Math.round(Double.parseDouble(getGestionnaireInterface().getStrTitrePoliceTaille())) + "px\"\n"
2451 + " titreTaillePolice2=\"" + taillePolice2 + "px\"\n"
2452 + " titreCalque=\"" + getGestionnaireInterface().getiCalqueTitre() + "\"\n";
2453
2454 if (getGestionnaireInterface().isbTitreAdapte()) {
2456 += " titreTaille=\"adapte\"\n";
2457 } else {
2459 += " titreTaille=\"" + Math.round(getGestionnaireInterface().getTitreTaille()) + "%\"\n";
2460 }
2462 += " titreFond=\"" + strCoulFondTitre + "\"\n"
2463 + " titreCouleur=\"" + getGestionnaireInterface().getStrCouleurTitre() + "\"\n"
2464 + " type=\"" + getPanoramiquesProjet()[i].getStrTypePanoramique() + "\"\n"
2465 + " multiReso=\"oui\"\n"
2466 + " nombreNiveaux=\"" + getPanoramiquesProjet()[i].getNombreNiveaux() + "\"\n"
2467 + " zeroNord=\"" + zN + "\"\n"
2468 + " regardX=\"" + regX + "\"\n"
2469 + " regardY=\"" + Math.round((getPanoramiquesProjet()[i].getRegardY() * 1000) + 0.002) / 1000.0 + "\"\n"
2470 + " minFOV=\"" + Math.round((getPanoramiquesProjet()[i].getFovMin() * 200)) / 100.0 + "\"\n"
2471 + " maxFOV=\"" + Math.round((getPanoramiquesProjet()[i].getFovMax() * 200)) / 100.0 + "\"\n"
2472 + " champVisuel=\"" + Math.round((getPanoramiquesProjet()[i].getChampVisuel() + 0.002) * 1000) / 1000.0 + "\"\n";
2473
2474 if (getPanoramiquesProjet()[i].getMinLat() != -1000 && getPanoramiquesProjet()[i].isbMinLat()) {
2476 += " minLat=\"" + Math.round((getPanoramiquesProjet()[i].getMinLat() + 0.002) * 1000) / 1000 + "\"\n";
2477 }
2478 if (getPanoramiquesProjet()[i].getMaxLat() != 1000 && getPanoramiquesProjet()[i].isbMaxLat()) {
2480 += " maxLat=\"" + Math.round((getPanoramiquesProjet()[i].getMaxLat() + 0.002) * 1000) / 1000 + "\"\n";
2481 }
2483 += " autorotation=\"" + strAutorotation + "\"\n"
2484 + " vitesseAR=\"" + getiAutoRotationVitesse() + "\"\n"
2485 + " autotour=\"" + strAutoTour + "\"\n"
2486 + " atBouton=\"" + strAutoTourBouton + "\"\n"
2487 + " atBoutonTaille=\"" + getGestionnaireInterface().getTailleBoutonVisiteAuto() + "\"\n"
2488 + " atBoutonPositionX=\"" + getGestionnaireInterface().getStrPositionXBoutonVisiteAuto() + "\"\n"
2489 + " atBoutonPositionY=\"" + getGestionnaireInterface().getStrPositionYBoutonVisiteAuto() + "\"\n"
2490 + " atBoutonOffsetX=\"" + getGestionnaireInterface().getOffsetXBoutonVisiteAuto() + "\"\n"
2491 + " atBoutonOffsetY=\"" + getGestionnaireInterface().getOffsetYBoutonVisiteAuto() + "\"\n"
2492 + " atCalque=\"" + getGestionnaireInterface().getiCalqueVisiteAuto() + "\"\n"
2493 + " typeAT=\"" + getStrAutoTourType() + "\"\n"
2494 + " limiteAT=\"" + getiAutoTourLimite() + "\"\n"
2495 + " demarrageAT=\"" + getiAutoTourDemarrage() + "\"\n"
2496 + " affinfo=\"" + strAffInfo + "\"\n";
2497
2498 // Ajout de l'affichage de la description
2499 if (getGestionnaireInterface().isbAfficheDescription()) {
2500 strContenuFichier += " affDescriptionChargement=\"oui\"\n";
2501 // Échapper les caractères spéciaux dans la description
2503 .replace("&", "&amp;")
2504 .replace("<", "&lt;")
2505 .replace(">", "&gt;")
2506 .replace("\"", "&quot;")
2507 .replace("'", "&apos;");
2508 strContenuFichier += " description=\"" + description + "\"\n";
2509 } else {
2510 strContenuFichier += " affDescriptionChargement=\"non\"\n";
2511 }
2512
2513 if (getPanoramiquesProjet()[i].getStrNomFichier()
2514 .substring(getPanoramiquesProjet()[i].getStrNomFichier().lastIndexOf(File.separator) + 1, getPanoramiquesProjet()[i].getStrNomFichier().length())
2516 strContenuFichier += " petitePlanete=\"" + strIntroPetitePlanete + "\"\n";
2517 }
2518 if (getPanoramiquesProjet()[i].getStrNomFichier()
2519 .substring(getPanoramiquesProjet()[i].getStrNomFichier().lastIndexOf(File.separator) + 1, getPanoramiquesProjet()[i].getStrNomFichier().length())
2520 .split("\\.")[0].equals(strPanoEntree) && getGestionnaireInterface().isbReplieDemarragePlan()) {
2521 strContenuFichier += " repliePlan=\"oui\"\n";
2522 }
2523 if (getPanoramiquesProjet()[i].getStrNomFichier()
2524 .substring(getPanoramiquesProjet()[i].getStrNomFichier().lastIndexOf(File.separator) + 1, getPanoramiquesProjet()[i].getStrNomFichier().length())
2525 .split("\\.")[0].equals(strPanoEntree) && getGestionnaireInterface().isbReplieDemarrageCarte()) {
2526 strContenuFichier += " replieCarte=\"oui\"\n";
2527 }
2528 if (getPanoramiquesProjet()[i].getStrNomFichier()
2529 .substring(getPanoramiquesProjet()[i].getStrNomFichier().lastIndexOf(File.separator) + 1, getPanoramiquesProjet()[i].getStrNomFichier().length())
2530 .split("\\.")[0].equals(strPanoEntree) && getGestionnaireInterface().isbReplieDemarrageVignettes()) {
2531 strContenuFichier += " replieVignettes=\"oui\"\n";
2532 }
2533
2534 strContenuFichier += " />\n";
2535 if (getGestionnaireInterface().getStrVisibiliteBarreClassique().equals("oui")) {
2537 += " <!--Définition de la Barre de navigation-->\n"
2538 + " <boutons \n"
2539 + " styleBoutons=\"navigation\"\n"
2540 + " couleur=\"rgba(255,255,255,0)\"\n"
2541 + " bordure=\"rgba(255,255,255,0)\"\n"
2542 + " deplacements=\"" + getGestionnaireInterface().getStrDeplacementsBarreClassique() + "\" \n"
2543 + " zoom=\"" + getGestionnaireInterface().getStrZoomBarreClassique() + "\" \n"
2544 + " outils=\"" + getGestionnaireInterface().getStrOutilsBarreClassique() + "\"\n"
2546 + " souris=\"" + getGestionnaireInterface().getStrSourisBarreClassique() + "\" \n"
2547 + " rotation=\"" + getGestionnaireInterface().getStrRotationBarreClassique() + "\" \n"
2548 + " positionX=\"" + getGestionnaireInterface().getStrPositionBarreClassique().split(":")[1] + "\"\n"
2549 + " positionY=\"" + getGestionnaireInterface().getStrPositionBarreClassique().split(":")[0] + "\" \n"
2550 + " barreCCalque=\"" + getGestionnaireInterface().getiCalqueBarreClassique() + "\"\n"
2551 + " dX=\"" + getGestionnaireInterface().getOffsetXBarreClassique() + "\" \n"
2552 + " dY=\"" + getGestionnaireInterface().getOffsetYBarreClassique() + "\"\n"
2553 + " espacement=\"" + Math.round(getGestionnaireInterface().getEspacementBarreClassique()) + "\"\n"
2554 + " visible=\"" + getGestionnaireInterface().getStrVisibiliteBarreClassique() + "\"\n"
2555 + " />\n";
2556 }
2557 if (getGestionnaireInterface().getStrVisibiliteBarrePersonnalisee().equals("oui")) {
2559 += "<!-- Barre de Navigation Personnalisée -->\n\n"
2560 + " <telecommande\n"
2562 + " souris=\"" + getGestionnaireInterface().getStrSourisBarrePersonnalisee() + "\" \n"
2563 + " rotation=\"" + getGestionnaireInterface().getStrRotationBarrePersonnalisee() + "\" \n"
2564 + " info=\"" + getGestionnaireInterface().getStrInfoBarrePersonnalisee() + "\"\n"
2565 + " aide=\"" + getGestionnaireInterface().getStrAideBarrePersonnalisee() + "\"\n"
2566 + " positionX=\"" + getGestionnaireInterface().getStrPositionBarrePersonnalisee().split(":")[1] + "\"\n"
2567 + " positionY=\"" + getGestionnaireInterface().getStrPositionBarrePersonnalisee().split(":")[0] + "\" \n"
2568 + " taille=\"" + getGestionnaireInterface().getTailleBarrePersonnalisee() + "\"\n"
2569 + " tailleBouton=\"" + getGestionnaireInterface().getTailleIconesBarrePersonnalisee() + "\"\n"
2570 + " opacite=\"" + getGestionnaireInterface().getOpaciteBarrePersonnalisee() + "\"\n"
2573 + " barrePCalque=\"" + getGestionnaireInterface().getiCalqueBarrePersonnalisee() + "\"\n"
2574 + " lien1=\"" + getGestionnaireInterface().getStrLien1BarrePersonnalisee() + "\"\n"
2575 + " lien2=\"" + getGestionnaireInterface().getStrLien2BarrePersonnalisee() + "\"\n"
2576 + " visible=\"oui\">\n";
2578 strContenuFichier += " <zoneNavPerso "
2580 + "alt=\"\" title=\"\" "
2583 + " />\n";
2584 }
2585 strContenuFichier += " </telecommande>\n"
2586 + "";
2587 }
2588 if (getGestionnaireInterface().isbAfficheBoussole()) {
2590 strContenuFichier += "<!-- Boussole -->\n"
2591 + " <boussole \n"
2592 + " affiche=\"oui\"\n"
2593 + " image=\"" + getGestionnaireInterface().getStrImageBoussole() + "\"\n"
2594 + " taille=\"" + getGestionnaireInterface().getTailleBoussole() + "\"\n"
2595 + " positionY=\"" + getGestionnaireInterface().getStrPositionBoussole().split(":")[0] + "\"\n"
2596 + " positionX=\"" + getGestionnaireInterface().getStrPositionBoussole().split(":")[1] + "\"\n"
2597 + " opacite=\"" + getGestionnaireInterface().getOpaciteBoussole() + "\"\n"
2598 + " dX=\"" + getGestionnaireInterface().getOffsetXBoussole() + "\"\n"
2599 + " dY=\"" + getGestionnaireInterface().getOffsetYBoussole() + "\"\n"
2600 + " boussoleCalque=\"" + getGestionnaireInterface().getiCalqueBoussole() + "\"\n"
2601 + " aiguille=\"" + strAiguille + "\"\n"
2602 + " />\n";
2603 }
2604 if (getGestionnaireInterface().isbFenetreInfoPersonnalise()) {
2605 String strImgInfoURL = "images/" + getGestionnaireInterface().getStrFenetreInfoImage().substring(getGestionnaireInterface().getStrFenetreInfoImage().lastIndexOf(File.separator) + 1,
2606 getGestionnaireInterface().getStrFenetreInfoImage().length());
2607 strContenuFichier += "<!-- Fenêtre info personnalisée -->\n"
2608 + " <fenetreInfo \n"
2609 + " affiche=\"oui\"\n"
2610 + " image=\"" + strImgInfoURL + "\"\n"
2611 + " taille=\"" + getGestionnaireInterface().getFenetreInfoTaille() + "\"\n"
2612 + " opacite=\"" + getGestionnaireInterface().getFenetreInfoOpacite() + "\"\n"
2613 + " dX=\"" + Math.round(getGestionnaireInterface().getFenetreInfoPosX() * 10) / 10 + "\"\n"
2614 + " dY=\"" + Math.round(getGestionnaireInterface().getFenetreInfoPosY() * 10) / 10 + "\"\n"
2615 + " URL=\"" + getGestionnaireInterface().getStrFenetreURL() + "\"\n"
2616 + " texteURL=\"" + getGestionnaireInterface().getStrFenetreTexteURL() + "\"\n"
2617 + " couleurURL=\"" + getGestionnaireInterface().getStrFenetreURLCouleur() + "\"\n"
2618 + " TailleURL=\"" + Math.round(getGestionnaireInterface().getFenetrePoliceTaille() * 10) / 10 + "\"\n"
2619 + " URLdX=\"" + Math.round(getGestionnaireInterface().getFenetreURLPosX() * 10) / 10 + "\"\n"
2620 + " URLdY=\"" + Math.round(getGestionnaireInterface().getFenetreURLPosY() * 10) / 10 + "\"\n"
2621 + " />\n";
2622 }
2623 if (getGestionnaireInterface().isbFenetreAidePersonnalise()) {
2624 String strImgAideURL = "images/" + getGestionnaireInterface().getStrFenetreAideImage().substring(getGestionnaireInterface().getStrFenetreAideImage().lastIndexOf(File.separator) + 1,
2625 getGestionnaireInterface().getStrFenetreAideImage().length());
2626 strContenuFichier += "<!-- Fenêtre Aide personnalisée -->\n"
2627 + " <fenetreAide \n"
2628 + " affiche=\"oui\"\n"
2629 + " image=\"" + strImgAideURL + "\"\n"
2630 + " taille=\"" + getGestionnaireInterface().getFenetreAideTaille() + "\"\n"
2631 + " opacite=\"" + getGestionnaireInterface().getFenetreAideOpacite() + "\"\n"
2632 + " dX=\"" + getGestionnaireInterface().getFenetreAidePosX() + "\"\n"
2633 + " dY=\"" + getGestionnaireInterface().getFenetreAidePosY() + "\"\n"
2634 + " />\n";
2635 }
2636 if (getGestionnaireInterface().isbAfficheMenuContextuel()) {
2641 strContenuFichier += "<!-- MenuContextuel -->\n"
2642 + " <menuContextuel \n"
2643 + " affiche=\"oui\"\n"
2644 + " precSuiv=\"" + strPrecSuiv + "\"\n"
2645 + " planete=\"" + strPlanet + "\"\n"
2646 + " pers1=\"" + strPers1 + "\"\n"
2647 + " lib1=\"" + getGestionnaireInterface().getStrPersLib1() + "\"\n"
2648 + " url1=\"" + getGestionnaireInterface().getStrPersURL1() + "\"\n"
2649 + " pers2=\"" + strPers2 + "\"\n"
2650 + " lib2=\"" + getGestionnaireInterface().getStrPersLib2() + "\"\n"
2651 + " url2=\"" + getGestionnaireInterface().getStrPersURL2() + "\"\n"
2652 + " />\n";
2653 }
2654
2655 int iPanoSuivant = (ii == ordPano.getStrPanos().size() - 1) ? 0 : ii + 1;
2656 int iPanoPrecedent = (ii == 0) ? ordPano.getStrPanos().size() - 1 : ii - 1;
2657 String strNomPano = "panovisu" + iPanoSuivant;
2658 String strPanoSuivant = "xml/" + strNomPano + ".xml";
2659 strNomPano = "panovisu" + iPanoPrecedent;
2660 String strPanoPrecedent = "xml/" + strNomPano + ".xml";
2661 strContenuFichier += "<!-- Bouton Suivant Precedent -->\n"
2662 + " <suivantPrecedent\n"
2663 + " suivPrecCalque=\"" + getGestionnaireInterface().getiCalqueSuivPrec() + "\"\n"
2664 + " suivant=\"" + strPanoSuivant + "\" \n"
2665 + " precedent=\"" + strPanoPrecedent + "\" \n";
2666 if (getGestionnaireInterface().isbSuivantPrecedent()) {
2667 strContenuFichier += " afficheSuivantPrecedent=\"oui\" \n";
2668
2669 }
2670 strContenuFichier += " /> \n"
2671 + "";
2676 String strPlan = (getGestionnaireInterface().isbMasquePlan()) ? "oui" : "non";
2682 strContenuFichier += "<!-- Bouton de Masquage -->\n"
2683 + " <marcheArret \n"
2684 + " affiche=\"" + strbAffichemasque + "\"\n"
2685 + " image=\"MA.png\"\n"
2686 + " taille=\"" + getGestionnaireInterface().getTailleMasque() + "\"\n"
2687 + " positionY=\"" + getGestionnaireInterface().getStrPositionMasque().split(":")[0] + "\"\n"
2688 + " positionX=\"" + getGestionnaireInterface().getStrPositionMasque().split(":")[1] + "\"\n"
2689 + " opacite=\"" + getGestionnaireInterface().getOpaciteMasque() + "\"\n"
2690 + " dX=\"" + getGestionnaireInterface().getdXMasque() + "\"\n"
2691 + " dY=\"" + getGestionnaireInterface().getdYMasque() + "\"\n"
2692 + " navigation=\"" + strNavigation + "\"\n"
2693 + " boussole=\"" + strBoussole + "\"\n"
2694 + " titre=\"" + strTitre + "\"\n"
2695 + " plan=\"" + strPlan + "\"\n"
2696 + " reseaux=\"" + strReseaux + "\"\n"
2697 + " masquageCalque=\"" + getGestionnaireInterface().getiCalqueMasquage() + "\"\n"
2698 + " vignettes=\"" + strVignettes + "\"\n"
2699 + " combo=\"" + strCombo + "\"\n"
2700 + " suivPrec=\"" + strSuivPrec + "\"\n"
2701 + " hotspots=\"" + strHotspots + "\"\n"
2702 + " />\n";
2703
2704 if (getGestionnaireInterface().isbAfficheReseauxSociaux()) {
2708 strContenuFichier += "<!-- Réseaux Sociaux -->\n"
2709 + " <reseauxSociaux \n"
2710 + " affiche=\"oui\"\n"
2711 + " taille=\"" + getGestionnaireInterface().getTailleReseauxSociaux() + "\"\n"
2712 + " positionY=\"" + getGestionnaireInterface().getStrPositionReseauxSociaux().split(":")[0] + "\"\n"
2713 + " positionX=\"" + getGestionnaireInterface().getStrPositionReseauxSociaux().split(":")[1] + "\"\n"
2714 + " opacite=\"" + getGestionnaireInterface().getOpaciteReseauxSociaux() + "\"\n"
2715 + " dX=\"" + getGestionnaireInterface().getdXReseauxSociaux() + "\"\n"
2716 + " dY=\"" + getGestionnaireInterface().getdYReseauxSociaux() + "\"\n"
2717 + " partageCalque=\"" + getGestionnaireInterface().getiCalquePartage() + "\"\n"
2718 + " twitter=\"" + strTwitter + "\"\n"
2719 + " meta=\"" + strMeta + "\"\n"
2720 + " email=\"" + strEmail + "\"\n"
2721 + " />\n";
2722 }
2723 if (getGestionnaireInterface().isbAfficheVignettes()) {
2724 int iRougeVig = (int) (Color.valueOf(getGestionnaireInterface().getStrCouleurFondVignettes()).getRed() * 255.d);
2727 String strCoulVig = "rgba(" + iRougeVig + "," + iVertVig + "," + iBleuVig + "," + getGestionnaireInterface().getOpaciteVignettes() + ")";
2729 strContenuFichier += "<!-- Barre des vignettes -->"
2730 + " <vignettes \n"
2731 + " affiche=\"" + strAfficheVignettes + "\"\n"
2732 + " tailleImage=\"" + getGestionnaireInterface().getTailleImageVignettes() + "\"\n"
2733 + " fondCouleur=\"" + strCoulVig + "\"\n"
2734 + " texteCouleur=\"" + getGestionnaireInterface().getStrCouleurTexteVignettes() + "\"\n"
2735 + " opacite=\"1.0\"\n"
2736 + " vignettesCalque=\"" + getGestionnaireInterface().getiCalqueVignettes() + "\"\n"
2737 + " position=\"" + getGestionnaireInterface().getStrPositionVignettes() + "\"\n"
2738 + " >\n";
2739 for (int jj = 0; jj < ordPano.getStrPanos().size(); jj++) {
2740 int j = Integer.parseInt(ordPano.getStrPanos().get(jj));
2741 @SuppressWarnings("unused")
2743 String strFichier = "panovisu" + j + "Vignette.jpg";
2744 String strXML = "panovisu" + j + ".xml";
2745 ReadWriteImage.writeJpeg(getPanoramiquesProjet()[j].getImgVignettePanoramique(),
2746 getStrRepertTemp() + "/panos/" + strFichier, 1.0f, false, 0.0f);
2748 += " <imageVignette \n"
2749 + " image=\"panos/" + strFichier + "\"\n"
2750 + " xml=\"xml/" + strXML + "\"\n"
2751 + " infoBulle=\"" + getPanoramiquesProjet()[j].getStrTitrePanoramique() + "\"\n"
2752 + " />\n";
2753 }
2755 += " </vignettes> \n"
2756 + "";
2757
2758 }
2759 if (getGestionnaireInterface().isbAfficheComboMenu()) {
2761 TextField tfTitreVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
2763 strContenuFichier += "<!-- Barre des comboMenu -->"
2764 + " <comboMenu \n"
2765 + " affiche=\"" + strAfficheComboMenu + "\"\n"
2766 + " positionX=\"" + getGestionnaireInterface().getStrPositionXComboMenu() + "\"\n"
2767 + " positionY=\"" + getGestionnaireInterface().getStrPositionYComboMenu() + "\"\n"
2768 + " dX=\"" + getGestionnaireInterface().getOffsetXComboMenu() + "\"\n"
2769 + " comboCalque=\"" + getGestionnaireInterface().getiCalqueMenuPanoramiques() + "\"\n"
2770 + " dY=\"" + getGestionnaireInterface().getOffsetYComboMenu() + "\"\n"
2771 + " >\n";
2772 for (int jj = 0; jj < ordPano.getStrPanos().size(); jj++) {
2773 int j = Integer.parseInt(ordPano.getStrPanos().get(jj));
2774 @SuppressWarnings("unused")
2776 String strFichier = "panovisu" + j + "Vignette.jpg";
2777 String strXML = "panovisu" + j + ".xml";
2778 ReadWriteImage.writeJpeg(getPanoramiquesProjet()[j].getImgVignettePanoramique(),
2779 getStrRepertTemp() + "/panos/" + strFichier, 1.0f, false, 0.0f);
2780
2782 += " <imageComboMenu \n";
2783 if (getGestionnaireInterface().isbAfficheComboMenuImages()) {
2785 += " image=\"panos/" + strFichier + "\"\n";
2786 }
2787 if (i == j) {
2789 += " selectionne=\"selected\"\n";
2790 }
2792 += " xml=\"xml/" + strXML + "\"\n"
2793 + " titre=\"" + getPanoramiquesProjet()[j].getStrTitrePanoramique() + "\"\n"
2794 + " sousTitre=\"" + strTitreVisite1 + "\"\n"
2795 + " />\n";
2796 }
2798 += " </comboMenu> \n"
2799 + "";
2800
2801 }
2802
2803 strContenuFichier += " <!--Définition des hotspots--> \n"
2804 + " <hotspots>\n";
2805 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspots(); j++) {
2807 double longit;
2808 if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
2809 longit = HS.getLongitude() - 180;
2810 } else {
2811 longit = HS.getLongitude() + 90;
2812 }
2813 String strTypeAnimation = HS.getStrTypeAnimation();
2814 @SuppressWarnings("unused")
2815 String strAnime = (HS.isAnime()) ? "true" : "false";
2817 += " <point \n"
2818 + " type=\"panoramique\"\n"
2819 + " long=\"" + longit + "\"\n"
2820 + " lat=\"" + HS.getLatitude() + "\"\n"
2821 + " tailleHS=\"" + getGestionnaireInterface().getiTailleHotspotsPanoramique() + "px\"\n";
2822
2823 // Utiliser l'icône colorée personnalisée si disponible
2824 if (HS.getStrFichierImage() != null && !HS.getStrFichierImage().isEmpty()) {
2826 += " image=\"panovisu/images/hotspots/" + HS.getStrFichierImage() + "\"\n";
2827 } else if (!strTypeHS.equals("gif")) {
2829 += " image=\"panovisu/images/hotspots/hotspot.png\"\n";
2830 } else {
2831 String strNomHSGif = strNomfichierHS.substring(strNomfichierHS.lastIndexOf(File.separator) + 1);
2833 += " image=\"panovisu/images/hotspots/" + strNomHSGif + "\"\n";
2834 }
2836 += " xml=\"xml/panovisu" + HS.getNumeroPano() + ".xml\"\n";
2837 if (HS.getRegardX() != 1000) {
2838 strContenuFichier += " regardX=\"" + HS.getRegardX() + "\"\n";
2839 }
2840 if (HS.getRegardY() != 1000) {
2841 strContenuFichier += " regardY=\"" + HS.getRegardY() + "\"\n";
2842 }
2843 if (HS.getChampVisuel() != 0) {
2844 strContenuFichier += " champVisuel=\"" + HS.getChampVisuel() + "\"\n";
2845 }
2846 String strAgranditSurvol = (HS.isAgranditSurvol()) ? "true" : "false";
2847 strContenuFichier += " info=\"" + HS.getStrInfo().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;") + "\"\n"
2848 + " anime=\"" + strTypeAnimation + "\"\n"
2849 + " agranditSurvol=\"" + strAgranditSurvol + "\"\n"
2850 + " />\n";
2851 }
2852 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotHTML(); j++) {
2855 if (!HS.isbLienExterieur()) {
2856 HS.creeHTML(strHTMLPanoRepert + "/page" + j);
2857 strUrlHTML = "pagesHTML/" + i + "/page" + j + "/index.html";
2858 } else {
2859 strUrlHTML = HS.getStrURLExterieure();
2860 }
2861 Color coulTitreHTML = Color.valueOf(HS.getStrCouleurHTML());
2862 iRouge = (int) (coulTitreHTML.getRed() * 255.d);
2863 iBleu = (int) (coulTitreHTML.getBlue() * 255.d);
2864 iVert = (int) (coulTitreHTML.getGreen() * 255.d);
2865 String strCoulHTML = "rgba(" + iRouge + "," + iVert + "," + iBleu + "," + Math.round(HS.getOpaciteHTML() * 100.d) / 100.d + ")";
2866 double longit;
2868 longit = HS.getLongitude() - 180;
2869 } else {
2870 longit = HS.getLongitude() + 90;
2871 }
2872 String strTypeAnimation = HS.getStrTypeAnimation();
2873 @SuppressWarnings("unused")
2874 String strAnime = (HS.isAnime()) ? "true" : "false";
2875 String strAgranditSurvol = (HS.isAgranditSurvol()) ? "true" : "false";
2876
2878 += " <point \n"
2879 + " type=\"html\"\n"
2880 + " long=\"" + longit + "\"\n"
2881 + " lat=\"" + HS.getLatitude() + "\"\n"
2882 + " tailleHS=\"" + getGestionnaireInterface().getiTailleHotspotsHTML() + "px\"\n";
2883
2884 // Utiliser l'icône colorée personnalisée si disponible
2885 if (HS.getStrFichierImage() != null && !HS.getStrFichierImage().isEmpty()) {
2887 += " image=\"panovisu/images/hotspots/" + HS.getStrFichierImage() + "\"\n";
2888 } else if (!strTypeHSHTML.equals("gif")) {
2890 += " image=\"panovisu/images/hotspots/hotspotHTML.png\"\n";
2891 } else {
2892 String strNomHSGif = strNomfichierHSHTML.substring(strNomfichierHSHTML.lastIndexOf(File.separator) + 1);
2894 += " image=\"panovisu/images/hotspots/" + strNomHSGif + "\"\n";
2895 }
2897 += " url=\"" + strUrlHTML + "\"\n"
2898 + " info=\"" + HS.getStrInfo().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;") + "\"\n"
2899 + " taille=\"" + Math.round(HS.getLargeurHTML()) + "px\"\n"
2900 + " position=\"" + HS.getStrPositionHTML() + "\"\n"
2901 + " couleur=\"" + strCoulHTML + "\"\n"
2902 + " anime=\"" + strTypeAnimation + "\"\n"
2903 + " agranditSurvol=\"" + strAgranditSurvol + "\"\n"
2904 + " />\n";
2905 }
2906
2907 for (int j = 0; j < getPanoramiquesProjet()[i].getiNombreHotspotDiapo(); j++) {
2910
2911 strUrlHTML = "diaporama/diapo" + HS.getiNumDiapo() + ".html";
2912
2913 Color coulTitreHTML = Color.valueOf(diaporamas[HS.getiNumDiapo()].getStrCouleurFondDiaporama());
2914 iRouge = (int) (coulTitreHTML.getRed() * 255.d);
2915 iBleu = (int) (coulTitreHTML.getBlue() * 255.d);
2916 iVert = (int) (coulTitreHTML.getGreen() * 255.d);
2917 String strCoulHTML = "rgba(" + iRouge + "," + iVert + "," + iBleu + ","
2918 + Math.round(diaporamas[HS.getiNumDiapo()].getOpaciteDiaporama() * 100.d) / 100.d + ")";
2919 double longit;
2921 longit = HS.getLongitude() - 180;
2922 } else {
2923 longit = HS.getLongitude() + 90;
2924 }
2925 // Récupérer le type d'animation comme pour les hotspots photo
2926 String strTypeAnimation = HS.getStrTypeAnimation();
2927 if (strTypeAnimation == null || strTypeAnimation.isEmpty()) {
2928 strTypeAnimation = "blink"; // Animation par défaut
2929 }
2930
2932 += " <point \n"
2933 + " type=\"html\"\n"
2934 + " long=\"" + longit + "\"\n"
2935 + " lat=\"" + HS.getLatitude() + "\"\n"
2936 + " tailleHS=\"" + getGestionnaireInterface().getiTailleHotspotsImage() + "px\"\n";
2937 if (!strTypeHSImage.equals("gif")) {
2939 += " image=\"panovisu/images/hotspots/hotspotImage.png\"\n";
2940 } else {
2941 String strNomHSGif = strNomfichierHSImage.substring(strNomfichierHSImage.lastIndexOf(File.separator) + 1);
2943 += " image=\"panovisu/images/hotspots/" + strNomHSGif + "\"\n";
2944 }
2946 += " url=\"" + strUrlHTML + "\"\n"
2947 + " taille=\"90%\"\n"
2948 + " info=\"" + HS.getStrInfo().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;") + "\"\n"
2949 + " couleur=\"" + strCoulHTML + "\"\n"
2950 + " anime=\"" + strTypeAnimation + "\"\n"
2951 + " />\n";
2952 }
2953
2954 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotImage(); j++) {
2957 if (strCouleurFondImage.equals("")) {
2958 strCouleurFondImage = "#" + getGestionnaireInterface().getCouleurFondTheme().toString().substring(2, 8);
2959 }
2960 double opaciteImage = HS.getOpacite();
2961 if (opaciteImage == -1) {
2963 }
2965 iRouge = (int) (coulImage.getRed() * 255.d);
2966 iBleu = (int) (coulImage.getBlue() * 255.d);
2967 iVert = (int) (coulImage.getGreen() * 255.d);
2968 String strCoulImage = "rgba(" + iRouge + "," + iVert + "," + iBleu + ","
2969 + Math.round(opaciteImage * 100.d) / 100.d + ")";
2970
2971 double longit;
2973 longit = HS.getLongitude() - 180;
2974 } else {
2975 longit = HS.getLongitude() + 90;
2976 }
2977 String strTypeAnimation = HS.getStrTypeAnimation();
2978 @SuppressWarnings("unused")
2979 String strAnime = (HS.isAnime()) ? "true" : "false";
2980 String strAgranditSurvol = (HS.isAgranditSurvol()) ? "true" : "false";
2982 += " <point \n"
2983 + " type=\"image\"\n"
2984 + " long=\"" + longit + "\"\n"
2985 + " lat=\"" + HS.getLatitude() + "\"\n"
2986 + " tailleHS=\"" + getGestionnaireInterface().getiTailleHotspotsImage() + "px\"\n";
2987
2988 // Utiliser l'icône colorée personnalisée si disponible
2989 if (HS.getStrFichierImage() != null && !HS.getStrFichierImage().isEmpty()) {
2991 += " image=\"panovisu/images/hotspots/" + HS.getStrFichierImage() + "\"\n";
2992 } else if (!strTypeHSImage.equals("gif")) {
2994 += " image=\"panovisu/images/hotspots/hotspotImage.png\"\n";
2995 } else {
2996 String strNomHSGif = strNomfichierHSImage.substring(strNomfichierHSImage.lastIndexOf(File.separator) + 1);
2998 += " image=\"panovisu/images/hotspots/" + strNomHSGif + "\"\n";
2999 }
3001 += " img=\"images/" + HS.getStrLienImg() + "\"\n"
3002 + " info=\"" + HS.getStrInfo().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;") + "\"\n"
3003 + " couleur=\"" + strCoulImage + "\"\n"
3004 + " anime=\"" + strTypeAnimation + "\"\n"
3005 + " agranditSurvol=\"" + strAgranditSurvol + "\"\n"
3006 + " />\n";
3007 }
3008 strContenuFichier += " </hotspots>\n";
3009 strContenuFichier += "\n"
3010 + "<!-- Définition des images de fond -->\n"
3011 + "\n";
3012 if (getGestionnaireInterface().getiNombreImagesFond() > 0) {
3013 for (int k = 0; k < getGestionnaireInterface().getiNombreImagesFond(); k++) {
3015 String strImgFond = "images/" + imgFond.getStrFichierImage().substring(
3016 imgFond.getStrFichierImage().lastIndexOf(File.separator) + 1,
3017 imgFond.getStrFichierImage().length());
3018 String strMasquable = (imgFond.isMasquable()) ? "oui" : "non";
3019
3021 += " <imageFond\n"
3022 + " fichier=\"" + strImgFond + "\"\n"
3023 + " posX=\"" + imgFond.getStrPosX() + "\" \n"
3024 + " posY=\"" + imgFond.getStrPosY() + "\" \n"
3025 + " offsetX=\"" + imgFond.getOffsetX() + "\" \n"
3026 + " offsetY=\"" + imgFond.getOffsetY() + "\" \n"
3027 + " tailleX=\"" + imgFond.getTailleX() + "\" \n"
3028 + " tailleY=\"" + imgFond.getTailleY() + "\" \n"
3029 + " opacite=\"" + imgFond.getOpacite() + "\" \n"
3030 + " cible=\"" + imgFond.getStrCible() + "\" \n"
3031 + " calque=\"" + imgFond.getiCalqueImage() + "\"\n"
3032 + " masquable=\"" + strMasquable + "\" \n"
3033 + " url=\"" + imgFond.getStrUrl() + "\" \n"
3034 + " infobulle=\"" + imgFond.getStrInfobulle().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;") + "\" \n"
3035 + " />\n"
3036 + "";
3037 }
3038 }
3039 if (getGestionnaireInterface().isbAffichePlan() && getPanoramiquesProjet()[i].isAffichePlan()) {
3042 iRouge = (int) (getGestionnaireInterface().getCouleurFondPlan().getRed() * 255.d);
3043 iBleu = (int) (getGestionnaireInterface().getCouleurFondPlan().getBlue() * 255.d);
3044 iVert = (int) (getGestionnaireInterface().getCouleurFondPlan().getGreen() * 255.d);
3046 String strCoulFond = "rgba(" + iRouge + "," + iVert + "," + iBleu + "," + getGestionnaireInterface().getOpacitePlan() + ")";
3048 += " <plan\n"
3049 + " affiche=\"oui\" \n"
3050 + " image=\"images/" + planPano.getStrImagePlan() + "\"\n"
3051 + " largeur=\"" + getGestionnaireInterface().getLargeurPlan() + "\"\n"
3052 + " position=\"" + getGestionnaireInterface().getStrPositionPlan() + "\"\n"
3053 + " couleurFond=\"" + strCoulFond + "\"\n"
3054 + " couleurTexte=\"#" + getGestionnaireInterface().getStrCouleurTextePlan() + "\"\n"
3055 + " nord=\"" + planPano.getDirectionNord() + "\"\n"
3056 + " planCalque=\"" + getGestionnaireInterface().getiCalquePlan() + "\"\n"
3057 + " boussolePosition=\"" + planPano.getStrPosition() + "\"\n"
3058 + " boussoleX=\"" + planPano.getPositionX() + "\"\n"
3059 + " boussoleY=\"" + planPano.getPositionX() + "\"\n"
3060 + " radarAffiche=\"" + strAfficheRadar + "\"\n"
3061 + " radarTaille=\"" + Math.round(getGestionnaireInterface().getTailleRadar()) + "\"\n"
3062 + " radarCouleurFond=\"#" + getGestionnaireInterface().getStrCouleurFondRadar() + "\"\n"
3063 + " radarCouleurLigne=\"#" + getGestionnaireInterface().getStrCouleurLigneRadar() + "\"\n"
3064 + " radarOpacite=\"" + Math.round(getGestionnaireInterface().getOpaciteRadar() * 100.d) / 100.d + "\"\n"
3065 + " >\n";
3066 for (int iPoint = 0; iPoint < planPano.getNombreHotspots(); iPoint++) {
3067 double posX = planPano.getHotspot(iPoint).getLongitude() * getGestionnaireInterface().getLargeurPlan();
3068 double posY = planPano.getHotspot(iPoint).getLatitude()
3069 * planPano.getHauteurPlan() * getGestionnaireInterface().getLargeurPlan() / planPano.getLargeurPlan();
3070 if (planPano.getHotspot(iPoint).getNumeroPano() == i) {
3072 += " <pointPlan\n"
3073 + " positX=\"" + posX + "\"\n"
3074 + " positY=\"" + posY + "\"\n"
3075 + " xml=\"actif\"\n"
3076 + " /> \n";
3077
3078 } else {
3080 += " <pointPlan\n"
3081 + " positX=\"" + posX + "\"\n"
3082 + " positY=\"" + posY + "\"\n"
3083 + " xml=\"xml/panovisu" + planPano.getHotspot(iPoint).getNumeroPano() + ".xml\"\n"
3084 + " texte=\"" + planPano.getHotspot(iPoint).getStrInfo() + "\"\n"
3085 + " /> \n";
3086 }
3087 }
3089 += " </plan>\n";
3090 }
3091
3092 if (getGestionnaireInterface().isbAfficheCarte()) {
3093 iRouge = (int) (getGestionnaireInterface().getCouleurFondCarte().getRed() * 255.d);
3094 iBleu = (int) (getGestionnaireInterface().getCouleurFondCarte().getBlue() * 255.d);
3095 iVert = (int) (getGestionnaireInterface().getCouleurFondCarte().getGreen() * 255.d);
3097 String strCoulFond = "rgba(" + iRouge + "," + iVert + "," + iBleu + "," + getGestionnaireInterface().getOpaciteCarte() + ")";
3099 if (getGestionnaireInterface().getCoordCentreCarte() != null) {
3101 } else {
3103 }
3105 += " <carte\n"
3106 + " affiche=\"oui\" \n"
3107 + " largeur=\"" + getGestionnaireInterface().getLargeurCarte() + "\"\n"
3108 + " hauteur=\"" + getGestionnaireInterface().getHauteurCarte() + "\"\n"
3109 + " zoom=\"" + (getGestionnaireInterface().getiFacteurZoomCarte() + 1) + "\"\n"
3110 + " coordCentreLong=\"" + coords.getLongitude() + "\"\n"
3111 + " coordCentreLat=\"" + coords.getLatitude() + "\"\n"
3112 + " nomLayer=\"" + getGestionnaireInterface().getStrNomLayers() + "\"\n"
3113 + " position=\"" + getGestionnaireInterface().getStrPositionCarte() + "\"\n"
3114 + " carteCalque=\"" + getGestionnaireInterface().getiCalqueCarte() + "\"\n"
3115 + " bingAPIKey=\"" + getStrBingAPIKey() + "\"\n"
3116 + " couleurFond=\"" + strCoulFond + "\"\n"
3117 + " couleurTexte=\"#" + getGestionnaireInterface().getStrCouleurTexteCarte() + "\"\n"
3118 + " radarCarteAffiche=\"" + strAfficheRadarCarte + "\"\n"
3119 + " radarCarteTaille=\"" + Math.round(getGestionnaireInterface().getTailleRadarCarte()) + "\"\n"
3120 + " radarCarteCouleurFond=\"#" + getGestionnaireInterface().getStrCouleurFondRadarCarte() + "\"\n"
3121 + " radarCarteCouleurLigne=\"#" + getGestionnaireInterface().getStrCouleurLigneRadarCarte() + "\"\n"
3122 + " radarCarteOpacite=\"" + Math.round(getGestionnaireInterface().getOpaciteRadarCarte() * 100.d) / 100.d + "\"\n"
3123 + " >\n";
3124 for (int iPoint2 = 0; iPoint2 < getiNombrePanoramiques(); iPoint2++) {
3128 @SuppressWarnings("unused")
3130 .getStrNomFichier().substring(getPanoramiquesProjet()[iPoint2].getStrNomFichier()
3131 .lastIndexOf(File.separator) + 1, getPanoramiquesProjet()[iPoint2]
3132 .getStrNomFichier().length()).split("\\.")[0];
3133 String strHTML = "<span style='font-family : Verdana,Arial,sans-serif;font-weight:bold;font-size : 12px;'>"
3135 + "</span>";
3136 strHTML = strHTML.replace("<", "&lt;").replace(">", "&gt;");
3137 String strFichierXML = "panovisu" + iPoint2;
3138 if (iPoint2 == i) {
3140 += " <pointCarte\n"
3141 + " positX=\"" + posX + "\"\n"
3142 + " positY=\"" + posY + "\"\n"
3143 + " xml=\"actif\"\n"
3144 + " image=\"panos/" + strFichierXML + "Vignette.jpg\"\n"
3145 + " html=\"" + strHTML + "\"\n"
3146 + " /> \n";
3147
3148 } else {
3150 += " <pointCarte\n"
3151 + " positX=\"" + posX + "\"\n"
3152 + " positY=\"" + posY + "\"\n"
3153 + " xml=\"xml/" + strFichierXML + ".xml\"\n"
3154 + " image=\"panos/" + strFichierXML + "Vignette.jpg\"\n"
3155 + " html=\"" + strHTML + "\"\n"
3156 + " /> \n";
3157 }
3158
3159 }
3160 }
3162 += " </carte>\n";
3163 }
3164
3165 strContenuFichier += "</scene>\n";
3166 @SuppressWarnings("unused")
3168 String strNomXMLFile = "panovisu" + i + ".xml";
3169 fileXML = new File(fileXMLRepert + File.separator + strNomXMLFile);
3170 fileXML.setWritable(true);
3174 }
3175 }
3176 Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
3177 int iHauteur = (int) tailleEcran.getHeight() - 200;
3178 String strTitreVis = "Panovisu - visualiseur 100% html5 (three.js)";
3179 TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
3180 if (!tfVisite.getText().equals("")) {
3181 strTitreVis = tfVisite.getText();
3182 }
3184 String strFPano1 = "panos/" + strNomPano1.substring(strNomPano1.lastIndexOf(File.separator) + 1, strNomPano1.lastIndexOf(".")) + "Vignette.jpg";
3185
3186 String strFichierHTML = "<!DOCTYPE html>\n"
3187 + "<html lang=\"fr\">\n"
3188 + " <head>\n"
3189 + " <title>" + strTitreVis + "</title>\n"
3190 + " <meta charset=\"utf-8\">\n"
3191 + " <meta name=\"viewport\" content=\"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\">\n"
3192 + " <link rel=\"stylesheet\" media=\"screen\" href=\"panovisu/libs/jqueryMenu/jquery.contextMenu.css\" type=\"text/css\"/>\n"
3193 + " <link rel=\"stylesheet\" type=\"text/css\" href=\"panovisu/css/msdropdown/dd.css\" />\n"
3194 + " <link rel=\"stylesheet\" type=\"text/css\" href=\"panovisu/css/panovisu.css\" />\n"
3195 + " <meta name=\"url\" property=\"og:url\" content=\"\" />\n"
3196 + " <meta property=\"og:title\" name=\"twitter:title\" content=\"" + strTitreVis + "\" />\n"
3197 + " <meta itemprop=\"description\" property=\"og:description\" name=\"twitter:description\" content=\"Une page créée avec panoVisu Editeur : 100% Libre 100% HTML5\" />\n"
3198 + " <meta name=\"img\" property=\"og:image\" itemprop=\"image primaryImageOfPage\" content=\"./" + strFPano1 + "\" />\n"
3199 + " <script type=\"text/javascript\" src=\"panovisu/libs/openLayers/OpenLayers.js\"></script>\n"
3200 + " <script type=\"text/javascript\" src=\"panovisu/libs/openLayers/OpenStreetMap.js\"></script>\n"
3201 // Google Maps API obsolète v3.5 - désactivé (warnings + version retirée)
3202 // + " <script src=\"http://maps.google.com/maps/api/js?v=3.5&sensor=false\" style=\"\"></script>\n"
3203 // + " <script src=\"http://maps.gstatic.com/maps-api-v3/api/js/20/13/intl/fr_ALL/main.js\"></script>\n"
3204 + " <style>\n"
3205 + " .olControlLayerSwitcher\n"
3206 + " {\n"
3207 + " font-family: Verdana,Arial,sans-serif!important;\n"
3208 + " margin-top: 3px;\n"
3209 + " margin-left: 3px;\n"
3210 + " margin-bottom: 3px;\n"
3211 + " font-size: 10pt!important;\n"
3212 + " color: white;\n"
3213 + " background-color: transparent;\n"
3214 + " z-index: 10000;\n"
3215 + " background-color: #999!important;\n"
3216 + " color : #ff0!important;\n"
3217 + " max-width: 180px!important;\n"
3218 + " opacity: 0.95!important;\n"
3219 + " }\n"
3220 + " .olControlLayerSwitcher .layersDiv\n"
3221 + " {\n"
3222 + " padding-top: 5px;\n"
3223 + " padding-left: 10px;\n"
3224 + " padding-bottom: 5px;\n"
3225 + " padding-right: 10px;\n"
3226 + " background-color: #aaa!important;\n"
3227 + " color : #fff!important;\n"
3228 + " font-family: Verdana,Arial,sans-serif!important;\n"
3229 + " font-size: 10pt!important;\n"
3230 + " font-weight: normal!important;\n"
3231 + " max-width: 180px!important;\n"
3232 + " overflow: hidden!important;\n"
3233 + " opacity: 0.95!important;\n"
3234 + " } \n"
3235 + "\n"
3236 + " #infoBulle {\n"
3237 + " background: " + getGestionnaireInterface().strCouleurFondInfoBulle + ";\n"
3242 + " padding: 3px 10px;\n"
3243 + " opacity: " + Math.round(getGestionnaireInterface().opaciteInfoBulle * 10) / 10.0 + ";\n"
3244 + " color : " + getGestionnaireInterface().strCouleurTexteInfoBulle + ";\n"
3245 + " font-family: " + getGestionnaireInterface().strPoliceInfoBulle + ",Arial,sans-serif!important; \n"
3246 + " border-radius: " + getGestionnaireInterface().iArrondiTL + "px " + getGestionnaireInterface().iArrondiTR
3248 if (getGestionnaireInterface().bOmbreInfoBulle) {
3249 strFichierHTML += " box-shadow: 5px 5px 10px #444;\n";
3250 }
3251 strFichierHTML += " font-size : " + getGestionnaireInterface().taillePoliceInfoBulle + "px; \n"
3252 + " z-index : 10000000;\n"
3253 + " } \n"
3254 + "\n"
3255 + " </style>\n"
3256 + ""
3257 + " </head>\n"
3258 + " <body style='background-color:#777; margin-top: 8px; margin-bottom: 2px;overflow: hidden;'>\n"
3259 + " <header>\n"
3260 + "\n"
3261 + " </header>\n"
3262 + " <article style=\"height : " + iHauteur + "px;\">\n"
3263 + " <div style='background-color : #777' id=\"pano\">\n"
3264 + " </div>\n"
3265 + " </article>\n"
3266 + " <script src=\"panovisu/panovisuInit.js\"></script>\n"
3267 + " <script src=\"panovisu/panovisu.js\"></script>\n"
3268 + " <script>\n"
3269 + "\n"
3270 + " $(function() {\n"
3271 + " $('meta[name=img]').attr('content', document.location.href+\"" + strFPano1 + "\");\n"
3272 + " $('meta[name=url]').attr('content', document.location.href);\n"
3273 + " $(window).resize(function(){\n"
3274 + " $(\"article\").height($(window).height()-17);\n"
3275 + " $(\"#pano\").height($(window).height()-17);\n"
3276 + " })\n"
3277 + " $(\"article\").height($(window).height()-17);\n"
3278 + " $(\"#pano\").height($(window).height()-17);\n"
3279 + " ajoutePano({\n"
3280 + " langue : \"" + getLocale().toString() + "\",\n"
3281 + " panoramique: \"pano\",\n"
3282 + " minFOV: " + (navigateurPanoramique.getMinFov() * 2) + ",\n"
3283 + " maxFOV: " + (navigateurPanoramique.getMaxFov() * 2) + ",\n"
3284 + " fenX: \"100%\",\n"
3285 + " fenY: \"100%\",\n"
3286 + " xml: \"xml/PANO.xml\"\n"
3287 + " });\n"
3288 + " $(\".reseauSocial-twitter\").on(\"click\", function() {\n"
3289 + " window.open(\n"
3290 + " \"https://twitter.com/share?url=\" + document.location.href\n"
3291 + " );\n"
3292 + " return false;\n"
3293 + " });\n"
3294 + " $(\".reseauSocial-fb\").on(\"click\", function() {\n"
3295 + " url=\"http://www.facebook.com/sharer.php?s=100&p[url]=\" + encodeURIComponent(document.location.href)\n"
3296 + " + \"&p[images][0]=\" + encodeURIComponent(document.location.href + \"" + strFPano1 + "\")\n"
3297 + " + \"&p[title]=\" + encodeURIComponent(\"" + strTitreVis + "\")\n"
3298 + " + \"&p[summary]=\" + encodeURIComponent(\"Une page créée avec panoVisu Editeur : 100% Libre 100% HTML5\");\n"
3299 + " window.open(url);\n"
3300 + " return false;\n"
3301 + " });\n"
3302 + " $(\".reseauSocial-google\").on(\"click\", function() {\n"
3303 + " window.open(\n"
3304 + " \"https://plus.google.com/share?url=\" + document.location.href + \"&amp;hl=fr\"\n"
3305 + " );\n"
3306 + " return false;\n"
3307 + " });\n"
3308 + " $(\".reseauSocial-email\").attr(\"href\",\"mailto:?body=\" + document.location.href + \"&amp;hl=fr\");\n"
3309 + " });\n"
3310 + " </script>\n"
3311 + " </body>\n"
3312 + "</html>\n";
3313 int i = Integer.parseInt(ordPano.getStrPanos().get(0));
3314 strFichierHTML = strFichierHTML.replace("PANO", "panovisu" + i);
3315 File fileIndexHTML = new File(getStrRepertTemp() + File.separator + "index.html");
3316 fileIndexHTML.setWritable(true);
3320 }
3321
3322 // Créer le fichier .htaccess à la racine de la visite pour éviter la compression des images
3323 String strHtaccess = "# Configuration pour éviter la compression automatique des images\n"
3324 + "# Nécessaire pour préserver la qualité des panoramas haute résolution\n\n"
3325 + "# Désactiver mod_pagespeed complètement\n"
3326 + "<IfModule pagespeed_module>\n"
3327 + " ModPagespeed off\n"
3328 + " ModPagespeedDisableFilters rewrite_images,convert_jpeg_to_progressive,recompress_jpeg,resize_images,recompress_png,recompress_webp,convert_png_to_jpeg,convert_jpeg_to_webp\n"
3329 + "</IfModule>\n\n"
3330 + "# Empêcher la compression des images\n"
3331 + "<IfModule mod_headers.c>\n"
3332 + " # CloudFlare : désactiver Polish/Mirage/BGJ\n"
3333 + " Header set cf-polished \"off\"\n"
3334 + " Header set cf-bgj \"off\"\n"
3335 + " Header set cf-mirage \"off\"\n"
3336 + " \n"
3337 + " # Empêcher toute transformation proxy/CDN\n"
3338 + " <FilesMatch \"\\.(jpg|jpeg|png|gif|webp)$\">\n"
3339 + " Header set Cache-Control \"public, max-age=31536000, immutable, no-transform\"\n"
3340 + " Header unset Content-Encoding\n"
3341 + " Header set X-No-Compression \"1\"\n"
3342 + " </FilesMatch>\n"
3343 + "</IfModule>\n\n"
3344 + "# Désactiver la compression pour les images\n"
3345 + "<IfModule mod_deflate.c>\n"
3346 + " SetEnvIfNoCase Request_URI \\.(?:jpg|jpeg|png|gif|webp)$ no-gzip dont-vary\n"
3347 + "</IfModule>\n\n"
3348 + "# Bloquer les tentatives de redimensionnement automatique\n"
3349 + "<IfModule mod_rewrite.c>\n"
3350 + " RewriteEngine On\n"
3351 + " # Bloquer les paramètres de redimensionnement\n"
3352 + " RewriteCond %{QUERY_STRING} (width|height|resize|scale|thumbnail) [NC]\n"
3353 + " RewriteRule ^.*\\.(jpg|jpeg|png)$ - [F,L]\n"
3354 + "</IfModule>\n\n"
3355 + "# Types MIME corrects\n"
3356 + "<IfModule mod_mime.c>\n"
3357 + " AddType image/jpeg .jpg .jpeg\n"
3358 + " AddType image/png .png\n"
3359 + " AddType image/gif .gif\n"
3360 + " AddType image/webp .webp\n"
3361 + "</IfModule>\n";
3362
3363 File fileHtaccess = new File(getStrRepertTemp() + File.separator + ".htaccess");
3364 fileHtaccess.setWritable(true);
3367 bwHtaccess.write(strHtaccess);
3368 }
3369 System.out.println("✅ Fichier .htaccess créé à la racine de la visite");
3370
3371 if (isZip) {
3372 // Mode ZIP : sauvegarder automatiquement puis créer le ZIP
3374 } else {
3375 // Mode normal : demander le répertoire de sauvegarde
3377 dcRepertChoix.setTitle("Choix du repertoire de sauvegarde de la visite");
3378 // Utiliser le dernier répertoire de visite s'il existe, sinon le répertoire du projet
3382 } else {
3384 }
3385 dcRepertChoix.setInitialDirectory(fileRepert);
3386 File fileRepertVisite = dcRepertChoix.showDialog(null);
3387 if (fileRepertVisite != null) {
3388 String strNomRepertVisite = fileRepertVisite.getAbsolutePath();
3389 // Sauvegarder ce répertoire pour la prochaine fois
3391 try {
3393 } catch (IOException ex) {
3394 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
3395 }
3397
3398 // Démarrer le serveur HTTP local pour éviter les problèmes CORS
3400 try {
3401 // Arrêter le serveur précédent s'il est en cours
3402 if (server.isRunning()) {
3403 server.stop();
3404 }
3405
3407 server.start();
3408
3409 String serverUrl = server.getUrl();
3410
3411 Alert alert = new Alert(AlertType.INFORMATION);
3412 alert.setHeaderText(null);
3413 alert.setTitle(rbLocalisation.getString("main.dialog.generationVisite"));
3414 alert.setContentText(rbLocalisation.getString("main.dialog.generationVisiteMessage") + strNomRepertVisite + "\n\n"
3415 + "🌐 La visite sera accessible sur : " + serverUrl + "\n"
3416 + "⚠️ Ne fermez pas l'application pour conserver l'accès à la visite.");
3417 alert.showAndWait();
3418
3419 Application app = new Application() {
3420 @Override
3421 public void start(Stage stage) {
3422 }
3423 };
3424 // Ouvrir le navigateur avec le serveur HTTP local
3425 app.getHostServices().showDocument(serverUrl);
3426
3427 } catch (IOException ex) {
3428 System.err.println("❌ Erreur lors du démarrage du serveur HTTP : " + ex.getMessage());
3429 // Fallback : ouvrir en mode file:// (avec avertissement)
3430 Alert alertFallback = new Alert(AlertType.WARNING);
3431 alertFallback.setHeaderText(null);
3432 alertFallback.setTitle(rbLocalisation.getString("main.dialog.generationVisite"));
3433 alertFallback.setContentText(rbLocalisation.getString("main.dialog.generationVisiteMessage") + strNomRepertVisite + "\n\n"
3434 + "⚠️ Le serveur HTTP n'a pas pu démarrer.\n"
3435 + "La visite s'ouvrira en mode local (file://) ce qui peut causer des problèmes de sécurité.\n"
3436 + "Pour une expérience optimale, copiez le dossier sur un serveur web.");
3437 alertFallback.showAndWait();
3438
3439 Application app = new Application() {
3440 @Override
3441 public void start(Stage stage) {
3442 }
3443 };
3444 File indexFile = new File(strNomRepertVisite + File.separator + "index.html");
3445 app.getHostServices().showDocument(indexFile.toURI().toString());
3446 }
3447 }
3448 }
3449 } else {
3450 Alert alert = new Alert(AlertType.ERROR);
3451 alert.setTitle(rbLocalisation.getString("main.dialog.generationVisite"));
3452 alert.setHeaderText(null);
3453 alert.setContentText(rbLocalisation.getString("main.dialog.generationVisiteMessageErreur"));
3454 alert.showAndWait();
3455
3456 }
3457 }
3458
3459
3460
3465 private static void creerZipDepuisTemp() throws IOException {
3466 // Demander à l'utilisateur où sauvegarder le ZIP
3468 fileChooser.setTitle("Sauvegarder l'archive ZIP de la visite");
3469
3470 // Utiliser le nom du fichier PVU comme nom par défaut pour le ZIP
3471 String nomProjet = "visite"; // Nom par défaut
3472 try {
3473 if (fileProjet != null) {
3474 String nomFichier = fileProjet.getName();
3475 if (nomFichier.endsWith(".pvu")) {
3476 nomProjet = nomFichier.substring(0, nomFichier.length() - 4);
3477 }
3478 }
3479 } catch (Exception e) {
3480 // En cas d'erreur, garder le nom par défaut
3481 }
3482
3483 fileChooser.setInitialFileName(nomProjet + ".zip");
3484
3485 // Utiliser le dernier répertoire de visite s'il existe, sinon le répertoire du projet
3489 } else {
3491 }
3492 fileChooser.setInitialDirectory(fileRepert);
3493
3494 // Ajouter des filtres d'extension
3495 FileChooser.ExtensionFilter zipFilter = new FileChooser.ExtensionFilter("Archives ZIP (*.zip)", "*.zip");
3496 fileChooser.getExtensionFilters().add(zipFilter);
3497
3498 File zipFile = fileChooser.showSaveDialog(null);
3499 if (zipFile != null) {
3500 // Sauvegarder le répertoire pour la prochaine fois
3502 try {
3504 } catch (IOException ex) {
3505 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
3506 }
3507
3508 // Créer le fichier ZIP depuis le répertoire temporaire
3510
3511 // Afficher un message de succès
3512 Alert alert = new Alert(AlertType.INFORMATION);
3513 alert.setTitle(rbLocalisation.getString("main.dialog.generationVisite"));
3514 alert.setHeaderText(null);
3515 alert.setContentText("Archive ZIP de la visite créée avec succès :\\n" + zipFile.getAbsolutePath());
3516 alert.showAndWait();
3517 }
3518 }
3519
3524 private static void creerZipVisite() throws IOException {
3525 if (!bRepertSauveChoisi) {
3527 }
3528 if (!isbDejaSauve()) {
3529 projetSauve();
3530 }
3531 if (isbDejaSauve()) {
3532 // Utiliser la nouvelle méthode genereVisite avec le paramètre isZip=true
3533 genereVisite(true);
3534 } else {
3535 Alert alert = new Alert(AlertType.ERROR);
3536 alert.setTitle(rbLocalisation.getString("main.dialog.generationVisite"));
3537 alert.setHeaderText(null);
3538 alert.setContentText(rbLocalisation.getString("main.dialog.generationVisiteMessageErreur"));
3539 alert.showAndWait();
3540 }
3541 }
3542
3547 @SuppressWarnings("unused")
3549 // Réutiliser une partie de la logique de genereVisite()
3550 String strHTMLRepert = getStrRepertTemp() + "/pagesHTML";
3552 if (!fileHTMLRepert.exists()) {
3553 fileHTMLRepert.mkdirs();
3554 }
3555 deleteDirectory(getStrRepertTemp() + "/panovisu/images");
3556 File fileImagesRepert = new File(getStrRepertTemp() + "/panovisu/images");
3557 if (!fileImagesRepert.exists()) {
3558 fileImagesRepert.mkdirs();
3559 }
3560
3561 // Copier les ressources essentielles
3562 copieRepertoire(getStrRepertAppli() + File.separator + "panovisu", getStrRepertTemp() + "/panovisu");
3563 copieRepertoire(getStrRepertAppli() + File.separator + "css", getStrRepertTemp() + "/css");
3564
3565 // Créer un index.html de base
3566 String htmlContent = "<!DOCTYPE html>\\n<html>\\n<head>\\n<title>Visite Virtuelle</title>\\n</head>\\n<body>\\n<h1>Archive ZIP de la visite créée</h1>\\n<p>Extrayez ce fichier et ouvrez index.html dans un navigateur web.</p>\\n</body>\\n</html>";
3567 File indexFile = new File(getStrRepertTemp() + "/index.html");
3571 bw.write(htmlContent);
3572 }
3573 }
3574
3588
3597 File[] files = sourceDir.listFiles();
3598 if (files == null) return;
3599
3600 for (File file : files) {
3601 if (file.isDirectory()) {
3603 } else {
3604 // Calculer le chemin relatif
3605 String relativePath = rootDir.toURI().relativize(file.toURI()).getPath();
3606
3608 zos.putNextEntry(zipEntry);
3609
3611 byte[] buffer = new byte[1024];
3612 int length;
3613 while ((length = fis.read(buffer)) > 0) {
3614 zos.write(buffer, 0, length);
3615 }
3616 }
3617 zos.closeEntry();
3618 }
3619 }
3620 }
3621
3633 Platform.runLater(() -> {
3634 lblNiveaux.setText("Création niveau principal");
3635 });
3636
3637 double tailleNiv0 = 512.d;
3638 String strExtension = strFichierImage.substring(strFichierImage.length() - 3, strFichierImage.length());
3639 Image imgPano = null;
3640 if (strExtension.equals("tif")) {
3641 try {
3642 imgPano = ReadWriteImage.readTiff(strFichierImage);
3643 if (imgPano.getWidth() > 8192) {
3645
3646 }
3647 } catch (IOException ex) {
3648 Logger.getLogger(EditeurPanovisu.class
3649 .getName()).log(Level.SEVERE, null, ex);
3650 }
3651 } else {
3652 imgPano = new Image("file:" + strFichierImage);
3653 if (imgPano.getWidth() > 8192) {
3654 imgPano = new Image("file:" + strFichierImage, 8192, 4096, true, true);
3655 }
3656 }
3657 String strNomPano = strNomFichierSauvegarde.substring(strNomFichierSauvegarde.lastIndexOf(File.separator) + 1, strNomFichierSauvegarde.length()).split("\\.")[0] + ".jpg";
3658 String strFicImage = strRepertoire + File.separator + "panovisu" + iNumPanoXML + ".jpg";
3659 try {
3660 ReadWriteImage.writeJpeg(imgPano, strFicImage, 0.95f, true, 0.25f);
3661
3662 } catch (IOException ex) {
3663 Logger.getLogger(EditeurPanovisu.class
3664 .getName()).log(Level.SEVERE, null, ex);
3665 }
3666 int iNombreNiveaux = 0;
3667 if (imgPano != null) {
3668 double tailleImage = imgPano.getWidth();
3669 strFichierImage = strFicImage;
3670 iNombreNiveaux = (int) (Math.log(tailleImage / tailleNiv0) / Math.log(2.d)) + 1;
3671 int iNbNiv = iNombreNiveaux;
3672 for (int i = 0; i < iNombreNiveaux; i++) {
3673 int ii = i;
3675 Platform.runLater(() -> {
3676 lblNiveaux.setText("Création niveau " + ii + "/" + (iNbNiv - 1));
3677 pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 1.d / 3.d + 1.d / 3.d * ((double) ii) / iNombreNiv2) / (double) iTotal);
3678 });
3679 try {
3680 double tailleNiveau = tailleImage * Math.pow(2.d, i) / Math.pow(2.d, iNombreNiveaux);
3681 if (strExtension.equals("tif")) {
3682 try {
3683 imgPano = ReadWriteImage.readTiff(strFichierImage);
3685
3686 } catch (ImagingException ex) {
3687 Logger.getLogger(EditeurPanovisu.class
3688 .getName()).log(Level.SEVERE, null, ex);
3689 }
3690 } else {
3691 imgPano = new Image("file:" + strFichierImage, Math.round(tailleNiveau * 2.d) / 2.d, Math.round(tailleNiveau / 2.d), true, true);
3692 }
3695 if (!fileRepert.exists()) {
3696 fileRepert.mkdirs();
3697 }
3698 strNomPano = strNomFichierSauvegarde.substring(strNomFichierSauvegarde.lastIndexOf(File.separator) + 1, strNomFichierSauvegarde.length());
3699 strNomPano = strNomPano.substring(strNomPano.lastIndexOf(File.separator) + 1, strNomPano.length()).split("\\.")[0] + ".jpg";
3700 strFicImage = strRepNiveau + File.separator + "panovisu" + iNumPanoXML + ".jpg";
3701 if (i < iNombreNiveaux - 1) {
3702 ReadWriteImage.writeJpeg(imgPano, strFicImage, 0.90f, true, 0.2f);
3703 } else {
3704 ReadWriteImage.writeJpeg(imgPano, strFicImage, 0.95f, true, 0.25f);
3705 }
3706
3707 } catch (IOException ex) {
3708 Logger.getLogger(EditeurPanovisu.class
3709 .getName()).log(Level.SEVERE, null, ex);
3710 }
3711 }
3712 }
3713 return iNombreNiveaux;
3714 }
3715
3724 private static int iCreeNiveauxImageCube(String strFichierImage, String strRepertoire, int iNumPanoXML, String strFace) {
3725 Platform.runLater(() -> {
3726 lblNiveaux.setText("Création face : " + strFace + " niveau principal");
3727 });
3728 String strSuffixe = "";
3729 switch (strFace) {
3730 case "dessus":
3731 strSuffixe = "_u";
3732 break;
3733 case "dessous":
3734 strSuffixe = "_d";
3735 break;
3736 case "droite":
3737 strSuffixe = "_r";
3738 break;
3739 case "gauche":
3740 strSuffixe = "_l";
3741 break;
3742 case "devant":
3743 strSuffixe = "_f";
3744 break;
3745 case "derriere":
3746 strSuffixe = "_b";
3747 break;
3748 }
3749 double tailleNiv0 = 256.d;
3750 String strExtension = strFichierImage.substring(strFichierImage.length() - 3, strFichierImage.length());
3751 Image imgPano = null;
3752 if (strExtension.equals("tif")) {
3753 try {
3754 imgPano = ReadWriteImage.readTiff(strFichierImage);
3755 if (imgPano.getWidth() > 4096) {
3757
3758 }
3759 } catch (IOException ex) {
3760 Logger.getLogger(EditeurPanovisu.class
3761 .getName()).log(Level.SEVERE, null, ex);
3762 }
3763 } else {
3764 imgPano = new Image("file:" + strFichierImage);
3765 if (imgPano.getWidth() > 4096) {
3766 imgPano = new Image("file:" + strFichierImage, 4096, 4096, true, true);
3767 }
3768 }
3769 @SuppressWarnings("unused")
3770 String strNomPano = strFichierImage.substring(strFichierImage.lastIndexOf(File.separator) + 1, strFichierImage.length());
3772 try {
3773 ReadWriteImage.writeJpeg(imgPano, strFicImage, 0.92f, true, 0.3f);
3774
3775 } catch (IOException ex) {
3776 Logger.getLogger(EditeurPanovisu.class
3777 .getName()).log(Level.SEVERE, null, ex);
3778 }
3779 int iNombreNiveaux = 0;
3780 if (imgPano != null) {
3781 double tailleImage = imgPano.getWidth();
3782 iNombreNiveaux = (int) (Math.log(tailleImage / tailleNiv0) / Math.log(2.d)) + 1;
3783 int nbNiv = iNombreNiveaux;
3784 for (int i = 0; i < iNombreNiveaux; i++) {
3785 try {
3786 int ii = i;
3787 Platform.runLater(() -> {
3788 lblNiveaux.setText("Création face : " + strFace + " niveau " + ii + "/" + (nbNiv - 1));
3789 });
3790
3791 double tailleNiveau = tailleImage * Math.pow(2.d, i) / Math.pow(2.d, iNombreNiveaux);
3792 if (strExtension.equals("tif")) {
3793 try {
3794 imgPano = ReadWriteImage.readTiff(strFichierImage);
3796
3797 } catch (ImagingException ex) {
3798 Logger.getLogger(EditeurPanovisu.class
3799 .getName()).log(Level.SEVERE, null, ex);
3800 }
3801 } else {
3802 imgPano = new Image("file:" + strFichierImage, tailleNiveau, tailleNiveau, true, true);
3803 }
3804
3807 if (!fileRepert.exists()) {
3808 fileRepert.mkdirs();
3809 }
3810 strNomPano = strFichierImage.substring(strFichierImage.lastIndexOf(File.separator) + 1, strFichierImage.length());
3811 strFicImage = strRepNiveau + File.separator + "panovisu" + iNumPanoXML + strSuffixe + ".jpg";
3812 ReadWriteImage.writeJpeg(imgPano, strFicImage, 0.88f, true, 0.15f);
3813
3814 } catch (IOException ex) {
3815 Logger.getLogger(EditeurPanovisu.class
3816 .getName()).log(Level.SEVERE, null, ex);
3817 }
3818 }
3819 }
3820 return iNombreNiveaux;
3821 }
3822
3829 FileChooser.ExtensionFilter extFilterImage = new FileChooser.ExtensionFilter("Fichiers Image (JPG,BMP,TIFF)", "*.jpg", "*.bmp", "*.tif");
3830 FileChooser.ExtensionFilter extFilterJpeg = new FileChooser.ExtensionFilter("Fichiers JPEG (*.jpg)", "*.jpg");
3831 FileChooser.ExtensionFilter extFilterBmp = new FileChooser.ExtensionFilter("Fichiers BMP (*.bmp)", "*.bmp");
3832 FileChooser.ExtensionFilter extFilterTiff = new FileChooser.ExtensionFilter("Fichiers TIFF (*.tif)", "*.tif");
3833 File fileRepert = new File(getStrCurrentDir() + File.separator);
3834 fileChooser.setInitialDirectory(fileRepert);
3835 fileChooser.getExtensionFilters().addAll(extFilterJpeg, extFilterTiff, extFilterBmp, extFilterImage);
3836
3837 List<File> listFichiers = fileChooser.showOpenMultipleDialog(null);
3838 if (listFichiers != null) {
3839 getApAttends().setVisible(true);
3840 mbarPrincipal.setDisable(true);
3841 bbarPrincipal.setDisable(true);
3842 hbBarreBouton.setDisable(true);
3843 pbarAvanceChargement.setProgress(-1);
3844 tpEnvironnement.setDisable(true);
3845 int i = 0;
3846 File[] fileLstFich1 = new File[listFichiers.size()];
3847 @SuppressWarnings("unused")
3848 String[] typeFich1 = new String[listFichiers.size()];
3849 for (File fileFichier : listFichiers) {
3851 i++;
3852 }
3853 int iNb = i;
3854 lblDragDrop.setVisible(false);
3855 @SuppressWarnings("rawtypes")
3859 thrChargeFichiers.setDaemon(true);
3860 thrChargeFichiers.start();
3861
3862 }
3863
3864 }
3865
3872 @SuppressWarnings("rawtypes")
3874 return new Task() {
3875 @Override
3876 protected Object call() throws Exception {
3877 int i = 0;
3878 File[] fileLstFich1 = new File[listFichiers.length];
3879 String[] strTypeFich1 = new String[listFichiers.length];
3880 for (int jj = 0; jj < iNb; jj++) {
3882 String strNomfich = fileFichier.getAbsolutePath();
3883 String strExtension = strNomfich.substring(strNomfich.lastIndexOf(".") + 1, strNomfich.length()).toLowerCase();
3884 if (strExtension.equals("jpg") || strExtension.equals("bmp") || strExtension.equals("tif")) {
3885 Image imgPano = null;
3886 if (strExtension.equals("tif")) {
3887 try {
3888 imgPano = ReadWriteImage.readTiff(fileFichier.getAbsolutePath());
3889
3890 } catch (IOException ex) {
3891 Logger.getLogger(EditeurPanovisu.class
3892 .getName()).log(Level.SEVERE, null, ex);
3893 }
3894 } else {
3895 imgPano = new Image("file:" + fileFichier.getAbsolutePath());
3896 }
3897 strTypeFich1[i] = "";
3898 if (imgPano != null) {
3899 if (imgPano.getWidth() == 2 * imgPano.getHeight()) {
3902 i++;
3903 }
3904 if (imgPano.getWidth() == imgPano.getHeight()) {
3905 String strNom = fileFichier.getAbsolutePath().substring(0, fileFichier.getAbsolutePath().length() - 6);
3906 boolean bTrouveFichier = false;
3907 for (int j = 0; j < i; j++) {
3908 String strNom1 = "";
3909 if (fileLstFich1[j].getAbsolutePath().length() == fileFichier.getAbsolutePath().length()) {
3910 strNom1 = fileLstFich1[j].getAbsolutePath().substring(0, fileFichier.getAbsolutePath().length() - 6);
3911 }
3912 if (strNom.equals(strNom1)) {
3913 bTrouveFichier = true;
3914 }
3915 }
3916 if (!bTrouveFichier) {
3919 i++;
3920 }
3921 }
3922 }
3923
3924 }
3925 }
3926 File[] fileLstFich = new File[i];
3927 System.arraycopy(fileLstFich1, 0, fileLstFich, 0, i);
3928
3929 for (int ii = 0; ii < fileLstFich.length; ii++) {
3931 int iNumP = ii + 1;
3932 Platform.runLater(() -> {
3933 lblCharge.setText("pano " + iNumP + "/" + fileLstFich.length + " : " + fileFichier1.getPath());
3934 lblNiveaux.setText("");
3935 pbarAvanceChargement.setProgress((double) (iNumP - 1) / (double) fileLstFich.length);
3936 });
3937
3938 setbDejaSauve(false);
3939 mniSauveProjet.setDisable(false);
3940 setStrCurrentDir(fileFichier1.getParent());
3941 File fileImageRepert = new File(getStrRepertTemp() + File.separator + "panos");
3942
3943 if (!fileImageRepert.exists()) {
3944
3945 fileImageRepert.mkdirs();
3946 }
3947 setStrRepertPanos(fileImageRepert.getAbsolutePath());
3949 }
3950 return true;
3951 }
3952
3953 @SuppressWarnings({ "unchecked", "unused" })
3954 @Override
3960 protected void succeeded() {
3961 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
3962 super.succeeded();
3963 cbListeChoixPanoramique.getItems().clear();
3964 apVignettesPano.getChildren().clear();
3965 for (int i = 0; i < getiNombrePanoramiques(); i++) {
3967 String strNomPano = strFichierPano.substring(strFichierPano.lastIndexOf(File.separator) + 1, strFichierPano.length());
3968 cbListeChoixPanoramique.getItems().add(strNomPano);
3969 @SuppressWarnings("unused")
3970 String strExtension = getPanoramiquesProjet()[i].getStrNomFichier().substring(getPanoramiquesProjet()[i].getStrNomFichier().length() - 3, getPanoramiquesProjet()[i].getStrNomFichier().length());
3971 ImageView ivVignettePano = new ImageView(getPanoramiquesProjet()[i].getImgVignettePanoramique());
3972 ivVignettePano.setPreserveRatio(true);
3973 ivVignettePano.setFitWidth(iLargeurVignettes);
3974 ivVignettePano.setLayoutX(5);
3975 ivVignettePano.setLayoutY((iLargeurVignettes / 2 + 10) * i + 10);
3976 ivVignettePano.setCursor(Cursor.HAND);
3977 int iNumero = i;
3978 ivVignettePano.setOnMouseClicked((e) -> {
3980 });
3981 ivVignettePano.setOnMouseDragEntered((e) -> {
3982 ivVignettePano.setLayoutX(3);
3983 ivVignettePano.setStyle(
3984 "-fx-border-color : #fff;"
3985 + "-fx-border-width : 2px;"
3986 + "-fx-border-style :solid;");
3987 });
3988 ivVignettePano.setOnMouseDragExited((e) -> {
3989 ivVignettePano.setLayoutX(5);
3990 ivVignettePano.setStyle(
3991 "-fx-border-color : rgba(0,0,0,0);"
3992 + "-fx-border-width : 0px;"
3993 + "-fx-border-style :none;");
3994 });
3995
3996 apVignettesPano.getChildren().add(ivVignettePano);
3997
3998 }
3999 apVignettesPano.getChildren().add(rectVignettePano);
4000 getVbChoixPanoramique().setVisible(true);
4001 ivImagePanoramique.setImage(getPanoramiquesProjet()[getiPanoActuel()].getImgPanoramique());
4002 ivImagePanoramique.setSmooth(true);
4004 dejaCharge = false;
4007 setiNumPoints(0);
4013 ivVisiteGenere.setOpacity(1.0);
4014 ivGenereZip.setDisable(false);
4015 ivGenereZip.setOpacity(1.0);
4016 ivVisiteGenere.setDisable(false);
4017 ivGenereZip.setOpacity(1.0);
4018 ivGenereZip.setDisable(false);
4021 bPanoCharge = true;
4023 getApAttends().setVisible(false);
4024 mbarPrincipal.setDisable(false);
4025 bbarPrincipal.setDisable(false);
4026 hbBarreBouton.setDisable(false);
4027 tpEnvironnement.setDisable(false);
4028
4031 apListePanoTriable.setMaxHeight(apListePanoTriable.getPrefHeight());
4032 apListePanoTriable.setMinHeight(apListePanoTriable.getPrefHeight());
4033 apListePanoTriable.setVisible(true);
4034 apParametresVisite.getChildren().remove(apListePanoTriable);
4035 apParametresVisite.getChildren().add(apListePanoTriable);
4036 apListePanoTriable.setLayoutX(40);
4037 apListePanoTriable.setLayoutY(130);
4038 apParametresVisite.setPrefHeight(120 + apListePanoTriable.getPrefHeight() + 20);
4039 if (apParametresVisite.isVisible()) {
4040 apParametresVisite.setMinHeight(120 + apListePanoTriable.getPrefHeight() + 20);
4041 apParametresVisite.setMaxHeight(120 + apListePanoTriable.getPrefHeight() + 20);
4042 }
4044
4045 }
4046
4047 };
4048 }
4049
4053 private static void planAjouter() {
4055
4056 FileChooser.ExtensionFilter extFilterJpeg = new FileChooser.ExtensionFilter("Fichiers JPEG (*.jpg)", "*.jpg");
4057 FileChooser.ExtensionFilter extFilterBmp = new FileChooser.ExtensionFilter("Fichiers BMP (*.bmp)", "*.bmp");
4058 FileChooser.ExtensionFilter extFilterPng = new FileChooser.ExtensionFilter("Fichiers PNG (*.png)", "*.png");
4059 File repert = new File(getStrCurrentDir() + File.separator);
4060 fileChooser.setInitialDirectory(repert);
4061 fileChooser.getExtensionFilters().addAll(extFilterJpeg, extFilterPng, extFilterBmp);
4062
4063 File fileFichierPlan = fileChooser.showOpenDialog(null);
4064 if (fileFichierPlan != null) {
4065 getPlans()[getiNombrePlans()] = new Plan();
4068 File fileRepertoirePlan = new File(getStrRepertTemp() + File.separator + "images");
4069 if (!fileRepertoirePlan.exists()) {
4070 fileRepertoirePlan.mkdirs();
4071 }
4072 try {
4073 copieFichierRepertoire(fileFichierPlan.getAbsolutePath(), fileRepertoirePlan.getAbsolutePath());
4074
4075 } catch (IOException ex) {
4076 Logger.getLogger(EditeurPanovisu.class
4077 .getName()).log(Level.SEVERE, null, ex);
4078 }
4081 }
4082
4083 }
4084
4088 private static void clickBtnValidePano() {
4089 TextField tfTitrePano = (TextField) getScnPrincipale().lookup("#txttitrepano");
4090 if (tfTitrePano != null) {
4092 Label lblTitre = (Label) apParametresVisite.lookup("#lvTitre" + iPanoActuel);
4093 if (lblTitre != null) {
4094 lblTitre.setText(tfTitrePano.getText().toUpperCase());
4095 }
4096 for (int i = 0; i < ordPano.getCellulesPanoramiques().size(); i++) {
4097 if (ordPano.getCellulesPanoramiques().get(i).getiNumPano() == iPanoActuel) {
4098 ordPano.getCellulesPanoramiques().get(i).setStrTitrePanoramique(tfTitrePano.getText());
4099 }
4100 }
4101 }
4102 }
4103
4120 private static void reinitialiserProjet() {
4121 System.out.println("🔄 Réinitialisation complète du projet...");
4122
4123 // 🗑️ NETTOYER L'INTERFACE GRAPHIQUE DES HOTSPOTS
4124 // Supprimer les affichages dynamiques des hotspots avant de nettoyer les données
4125 try {
4126 if (vbVisuHotspots != null) {
4128 System.out.println(" ✓ Affichage hotspots retiré");
4129 }
4130 } catch (Exception e) {
4131 System.err.println(" ⚠️ Erreur retireAffichageHotSpots: " + e.getMessage());
4132 }
4133
4134 try {
4135 if (panePanoramique != null) {
4137 System.out.println(" ✓ Points hotspots retirés");
4138 }
4139 } catch (Exception e) {
4140 System.err.println(" ⚠️ Erreur retireAffichagePointsHotSpots: " + e.getMessage());
4141 }
4142
4143 // Nettoyer les vignettes de panoramiques
4144 try {
4145 if (apVignettesPano != null) {
4146 apVignettesPano.getChildren().clear();
4147 System.out.println(" ✓ Vignettes panoramiques nettoyées");
4148 }
4149 } catch (Exception e) {
4150 System.err.println(" ⚠️ Erreur nettoyage vignettes: " + e.getMessage());
4151 }
4152
4153 // Réinitialiser le flag dejaCharge
4154 dejaCharge = false;
4155
4156 // Réinitialiser tous les compteurs
4159 setiNumPoints(0);
4160 setiNumImages(0);
4161 setiNumHTML(0);
4162 setiNumDiapo(0);
4163 iNombreDiapo = 0;
4164 iNombrePlans = 0;
4165 iPanoActuel = 0;
4166
4167 // Nettoyer complètement le tableau des panoramiques
4168 // (ne pas juste réinitialiser le compteur, vider les références)
4169 for (int i = 0; i < panoramiquesProjet.length; i++) {
4170 if (panoramiquesProjet[i] != null) {
4171 // Nettoyer les hotspots du panoramique
4172 panoramiquesProjet[i] = null;
4173 }
4174 }
4176
4177 // Nettoyer complètement le tableau des diaporamas
4178 for (int i = 0; i < diaporamas.length; i++) {
4179 diaporamas[i] = null;
4180 }
4181 diaporamas = new Diaporama[100];
4182
4183 // Nettoyer complètement le tableau des plans
4184 for (int i = 0; i < plans.length; i++) {
4185 plans[i] = null;
4186 }
4187 plans = new Plan[20];
4188
4189 // Nettoyer l'interface utilisateur
4190 if (ivImagePanoramique != null) {
4191 ivImagePanoramique.setImage(null);
4192 }
4193 if (cbListeChoixPanoramique != null) {
4194 cbListeChoixPanoramique.getItems().clear();
4195 }
4196
4197 // Réinitialiser les variables de projet
4198 strPanoEntree = "";
4200 strTitreVisite = "";
4201
4202 // Réinitialiser le cache des descriptions IA
4203 try {
4205 } catch (Exception e) {
4206 System.err.println("⚠️ Erreur lors de la réinitialisation du cache IA: " + e.getMessage());
4207 }
4208
4209 System.out.println("✅ Projet réinitialisé - Mémoire nettoyée");
4210 }
4211
4218 if (!bRepertSauveChoisi) {
4220 }
4221 ButtonType reponse = null;
4222 ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
4223 ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
4224 ButtonType buttonTypeAnnule = new ButtonType(rbLocalisation.getString("main.annuler"));
4225 if (!isbDejaSauve()) {
4226 Alert alert = new Alert(AlertType.CONFIRMATION);
4227 alert.setHeaderText(null);
4228 alert.setTitle(rbLocalisation.getString("main.dialog.chargeProjet"));
4229 alert.setContentText(rbLocalisation.getString("main.dialog.chargeProjetMessage"));
4230 alert.getButtonTypes().clear();
4231 alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon, buttonTypeAnnule);
4232 Optional<ButtonType> actReponse = alert.showAndWait();
4233 reponse = actReponse.get();
4234 }
4235 if (reponse == buttonTypeOui) {
4236 try {
4237 projetSauve();
4238
4239 } catch (IOException ex) {
4240 Logger.getLogger(EditeurPanovisu.class
4241 .getName()).log(Level.SEVERE, null, ex);
4242 }
4243 }
4244 if ((reponse == buttonTypeOui) || (reponse == buttonTypeNon) || (reponse == null)) {
4245 panePanoramique.getChildren().clear();
4246 panePanoramique.getChildren().add(ivImagePanoramique);
4247 getApAttends().setVisible(true);
4248 mbarPrincipal.setDisable(true);
4249 bbarPrincipal.setDisable(true);
4250 hbBarreBouton.setDisable(true);
4251 tpEnvironnement.setDisable(true);
4252 setbDejaSauve(true);
4254 FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("fichier panoVisu (*.pvu)", "*.pvu");
4255 fcRepertChoix.getExtensionFilters().add(extFilter);
4256 File fileRepert = new File(getStrRepertoireProjet() + File.separator);
4257 fcRepertChoix.setInitialDirectory(fileRepert);
4258 fileProjet = null;
4259 fileProjet = fcRepertChoix.showOpenDialog(getStPrincipal());
4260 if (fileProjet != null) {
4261 // 🔄 RÉINITIALISATION COMPLÈTE : Nettoyer toutes les données du projet précédent
4263
4264 getStPrincipal().setTitle("Panovisu v" + strNumVersion.split("-")[0] + " : " + fileProjet.getAbsolutePath());
4265 lblDragDrop.setVisible(false);
4267 ajouteFichierHisto(fileProjet.getAbsolutePath());
4268 bRepertSauveChoisi = true;
4272 fileRptPanovisu.mkdirs();
4273 copieRepertoire(getStrRepertAppli() + File.separator + "panovisu", strRepertPanovisu);
4274 mnuPanoramique.setDisable(false);
4275 btnMnuPanoramique.setDisable(false);
4276 ivAjouterPano.setDisable(false);
4277 ivAjouterPano.setOpacity(1.0);
4278 ivSauveProjet.setDisable(false);
4279 ivSauveProjet.setOpacity(1.0);
4280 ivVisiteGenere.setDisable(false);
4281 ivVisiteGenere.setOpacity(1.0);
4282 ivGenereZip.setDisable(false);
4283 ivGenereZip.setOpacity(1.0);
4284
4285 getVbChoixPanoramique().setVisible(false);
4286
4287 mniSauveProjet.setDisable(false);
4288 mniSauveSousProjet.setDisable(false);
4289 mniVisiteGenere.setDisable(false);
4290 mniCreerZipVisite.setDisable(false);
4291
4292 // Les réinitialisations sont maintenant faites dans reinitialiserProjet()
4293 try {
4296 new FileInputStream(fileProjet), "UTF-8"))) {
4297 strTexte = "";
4300 while ((strLigneTexte = brFichierPVU.readLine()) != null) {
4301 if (strLigneTexte.contains("Panoramique=>")) {
4303 }
4304 strTexte += strLigneTexte + "\n";
4305 }
4306 }
4307 @SuppressWarnings("rawtypes")
4311 thrAnalysePVU.setDaemon(true);
4312 thrAnalysePVU.start();
4313
4314 } catch (FileNotFoundException ex) {
4315 Logger.getLogger(EditeurPanovisu.class
4316 .getName()).log(Level.SEVERE, null, ex);
4317 }
4318
4319 } else {
4320 // L'utilisateur a annulé le FileChooser - fermer la modale et réactiver l'interface
4321 getApAttends().setVisible(false);
4322 mbarPrincipal.setDisable(false);
4323 bbarPrincipal.setDisable(false);
4324 hbBarreBouton.setDisable(false);
4325 tpEnvironnement.setDisable(false);
4326 }
4327 }
4328 }
4329
4335 private static void ajouteFichierHisto(String nomFich) {
4336 if (nombreHistoFichiers > 10) {
4338 }
4339 int iTrouve = -1;
4340 for (int i = 0; i < nombreHistoFichiers; i++) {
4342 iTrouve = i;
4343 }
4344 }
4345 if (iTrouve == -1) {
4346 for (int i = nombreHistoFichiers; i >= 0; i--) {
4347 if (i < 9) {
4349 }
4350 }
4352 if (nombreHistoFichiers < 10) {
4354 }
4355 } else {
4356 for (int i = iTrouve - 1; i >= 0; i--) {
4357 if (i < 9) {
4359 }
4360 }
4362
4363 }
4364 mnuDerniersProjets.getItems().clear();
4365 for (int i = 0; i < nombreHistoFichiers; i++) {
4366 if (strHistoFichiers[i] != null) {
4369 mniDerniersFichiers.setOnAction((e) -> {
4370 MenuItem mniFichier = (MenuItem) e.getSource();
4371
4372 try {
4373 try {
4374 projetChargeNom(mniFichier.getText());
4375
4376 } catch (InterruptedException ex) {
4377 Logger.getLogger(EditeurPanovisu.class
4378 .getName()).log(Level.SEVERE, null, ex);
4379 }
4380
4381 } catch (IOException ex) {
4382 Logger.getLogger(EditeurPanovisu.class
4383 .getName()).log(Level.SEVERE, null, ex);
4384 }
4385 });
4386 }
4387 }
4388
4389 }
4390
4399 if (fileProjet1.exists()) {
4400 ButtonType reponse = null;
4401 ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
4402 ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
4403 ButtonType buttonTypeAnnule = new ButtonType(rbLocalisation.getString("main.annuler"));
4404 if (!isbDejaSauve()) {
4405 Alert alert = new Alert(AlertType.CONFIRMATION);
4406 alert.setTitle(rbLocalisation.getString("main.dialog.chargeProjet"));
4407 alert.setHeaderText(null);
4408 alert.setContentText(rbLocalisation.getString("main.dialog.chargeProjetMessage"));
4409 alert.getButtonTypes().clear();
4410 alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon, buttonTypeAnnule);
4411 Optional<ButtonType> actReponse = alert.showAndWait();
4412 reponse = actReponse.get();
4413 }
4414 if (reponse == buttonTypeOui) {
4415 try {
4416 projetSauve();
4417
4418 } catch (IOException ex) {
4419 Logger.getLogger(EditeurPanovisu.class
4420 .getName()).log(Level.SEVERE, null, ex);
4421 }
4422 }
4423 if ((reponse == buttonTypeOui) || (reponse == buttonTypeNon) || (reponse == null)) {
4424 panePanoramique.getChildren().clear();
4425 panePanoramique.getChildren().add(ivImagePanoramique);
4426 getApAttends().setVisible(true);
4427 mbarPrincipal.setDisable(true);
4428 bbarPrincipal.setDisable(true);
4429 hbBarreBouton.setDisable(true);
4430 tpEnvironnement.setDisable(true);
4431 lblDragDrop.setVisible(false);
4432 setbDejaSauve(true);
4433
4434 // 🔄 RÉINITIALISATION COMPLÈTE : Nettoyer toutes les données du projet précédent
4436
4438 ajouteFichierHisto(fileProjet.getAbsolutePath());
4439 getStPrincipal().setTitle("Panovisu v" + strNumVersion.split("-")[0] + " : " + fileProjet.getAbsolutePath());
4441 bRepertSauveChoisi = true;
4445 fileRptPanovisu.mkdirs();
4446 copieRepertoire(getStrRepertAppli() + File.separator + "panovisu", strRepertPanovisu);
4447 mnuPanoramique.setDisable(false);
4448 btnMnuPanoramique.setDisable(false);
4449 ivAjouterPano.setDisable(false);
4450 ivAjouterPano.setOpacity(1.0);
4451 ivSauveProjet.setDisable(false);
4452 ivSauveProjet.setOpacity(1.0);
4453 ivVisiteGenere.setDisable(false);
4454 ivVisiteGenere.setOpacity(1.0);
4455 ivGenereZip.setDisable(false);
4456 ivGenereZip.setOpacity(1.0);
4457
4458 getVbChoixPanoramique().setVisible(false);
4459
4460 mniSauveProjet.setDisable(false);
4461 mniSauveSousProjet.setDisable(false);
4462 mniVisiteGenere.setDisable(false);
4463 mniCreerZipVisite.setDisable(false);
4464
4465 // Les réinitialisations sont maintenant faites dans reinitialiserProjet()
4466 try {
4469 new FileInputStream(fileProjet), "UTF-8"))) {
4470 strTexte = "";
4473 while ((strLigneTexte = br.readLine()) != null) {
4474 if (strLigneTexte.contains("Panoramique=>")) {
4476 }
4477 strTexte += strLigneTexte + "\n";
4478 }
4479 }
4480 @SuppressWarnings("rawtypes")
4484 thrAnalysePVU.setDaemon(true);
4485 thrAnalysePVU.start();
4486
4487 } catch (FileNotFoundException ex) {
4488 Logger.getLogger(EditeurPanovisu.class
4489 .getName()).log(Level.SEVERE, null, ex);
4490 }
4491 }
4492 }
4493 }
4494
4499 private static void sauveFichierProjet() throws IOException {
4501 bRepertSauveChoisi = true;
4502 File fileFichierProjet = new File(fileProjet.getAbsolutePath());
4503 if (!fileFichierProjet.exists()) {
4504 fileFichierProjet.createNewFile();
4505 }
4506 setbDejaSauve(true);
4507 getStPrincipal().setTitle("Panovisu v" + strNumVersion.split("-")[0] + " : " + fileProjet.getAbsolutePath());
4508
4510 TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
4511 if (!tfVisite.getText().equals("")) {
4512 strContenuFichier += "[titreVisite=>" + tfVisite.getText() + "]\n";
4513 }
4514 if (!strPanoEntree.equals("")) {
4515 strContenuFichier += "[PanoEntree=>" + strPanoEntree + "]\n";
4516 }
4517 strContenuFichier += "[introLP=>" + isbIntroPetitePlanete() + "]\n";
4518 strContenuFichier += "[arDemarre=>" + isbAutoRotationDemarre() + "]\n";
4519 strContenuFichier += "[arVitesse=>" + getiAutoRotationVitesse() + "]\n";
4520 strContenuFichier += "[atDemarre=>" + isbAutoTourDemarre() + "]\n";
4521 strContenuFichier += "[atVitesse=>" + getiAutoTourLimite() + "]\n";
4522 strContenuFichier += "[atDemarrage=>" + getiAutoTourDemarrage() + "]\n";
4523 strContenuFichier += "[atType=>" + getStrAutoTourType() + "]\n";
4524 strOrdrePanos = "";
4525 ordPano.getStrPanos().stream().forEach((strOrd) -> {
4526 strOrdrePanos += strOrd + ",";
4527 });
4528 strOrdrePanos = strOrdrePanos.substring(0, strOrdrePanos.length() - 1);
4529 strContenuFichier += "[OrdrePanos=>" + strOrdrePanos + "]\n";
4530 for (int i = 0; i < getiNombrePanoramiques(); i++) {
4531 strContenuFichier += "[Panoramique=>"
4532 + "fichier:" + strEncodeFichier(getPanoramiquesProjet()[i].getStrNomFichier())
4535 + ";nbHTML:" + getPanoramiquesProjet()[i].getNombreHotspotHTML()
4537 + ";titre:" + getPanoramiquesProjet()[i].getStrTitrePanoramique() + ""
4539 + ";afficheInfo:" + getPanoramiquesProjet()[i].isAfficheInfo()
4540 + ";afficheTitre:" + getPanoramiquesProjet()[i].isAfficheTitre()
4541 + ";affDescription:" + getPanoramiquesProjet()[i].isAffDescription()
4542 + ";regardX:" + getPanoramiquesProjet()[i].getRegardX()
4543 + ";regardY:" + getPanoramiquesProjet()[i].getRegardY()
4544 + ";minLat:" + getPanoramiquesProjet()[i].getMinLat()
4545 + ";maxLat:" + getPanoramiquesProjet()[i].getMaxLat()
4546 + ";bMinLat:" + getPanoramiquesProjet()[i].isbMinLat()
4547 + ";bMaxLat:" + getPanoramiquesProjet()[i].isbMaxLat()
4548 + ";fov:" + (getPanoramiquesProjet()[i].getChampVisuel() * 2)
4549 + ";minfov:" + (getPanoramiquesProjet()[i].getFovMin() * 2)
4550 + ";maxfov:" + (getPanoramiquesProjet()[i].getFovMax() * 2)
4551 + ";zeroNord:" + getPanoramiquesProjet()[i].getZeroNord()
4552 + ";affichePlan:" + getPanoramiquesProjet()[i].isAffichePlan()
4553 + ";numeroPlan:" + getPanoramiquesProjet()[i].getNumeroPlan();
4554 if (getPanoramiquesProjet()[i].getMarqueurGeolocatisation() != null) {
4557 }
4558 // Description IA
4560 System.out.println("[DEBUG] Pano " + i + " - Description IA: '" + descIA + "' (longueur: " + descIA.length() + ", vide: " + descIA.isEmpty() + ")");
4561 if (!descIA.isEmpty()) {
4562 String descEscapee = descIA.replace(";", "&pv").replace(":", "&dp").replace("\n", "&nl");
4563 System.out.println("[DEBUG] Pano " + i + " - Description IA échappée: '" + descEscapee + "'");
4564 strContenuFichier += ";descriptionIA:" + descEscapee;
4565 } else {
4566 System.out.println("[DEBUG] Pano " + i + " - Description IA vide, non sauvegardée");
4567 }
4568 strContenuFichier += "]\n";
4569 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspots(); j++) {
4571 strContenuFichier += " [hotspot==>"
4572 + "longitude:" + HS.getLongitude()
4573 + ";latitude:" + HS.getLatitude()
4574 + ";image:" + HS.getStrFichierImage()
4575 + ";xml:" + HS.getStrFichierXML()
4576 + ";numXML:" + HS.getNumeroPano()
4577 + ";info:" + HS.getStrInfo().replace(";", "&pv").replace(":", "&dp")
4578 + ";typeAnimation:" + HS.getStrTypeAnimation()
4579 + ";agranditSurvol:" + HS.isAgranditSurvol()
4580 + ";couleurPerso:" + (HS.getStrCouleurPerso() != null ? HS.getStrCouleurPerso().replace(";", "&pv") : "")
4581 + ";nomIconeSource:" + (HS.getStrNomIconeSource() != null ? HS.getStrNomIconeSource() : "");
4582 if (HS.getRegardX() != 1000) {
4583 strContenuFichier += ";regardX:" + HS.getRegardX();
4584 }
4585 if (HS.getRegardY() != 1000) {
4586 strContenuFichier += ";regardY:" + HS.getRegardY();
4587 }
4588 if (HS.getChampVisuel() != 0) {
4589 strContenuFichier += ";champVisuel:" + (HS.getChampVisuel() * 2);
4590 }
4591 strContenuFichier += "]\n";
4592 }
4593 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotImage(); j++) {
4595 strContenuFichier += " [hotspotImage==>"
4596 + "longitude:" + HS.getLongitude()
4597 + ";latitude:" + HS.getLatitude()
4598 + ";image:" + HS.getStrFichierImage()
4599 + ";img:" + HS.getStrLienImg()
4600 + ";urlImg:" + HS.getStrUrlImage()
4601 + ";couleur:" + HS.getStrCouleurFond()
4602 + ";opacite:" + HS.getOpacite()
4603 + ";info:" + HS.getStrInfo().replace(";", "&pv").replace(":", "&dp")
4604 + ";typeAnimation:" + HS.getStrTypeAnimation()
4605 + ";agranditSurvol:" + HS.isAgranditSurvol()
4606 + ";couleurPerso:" + (HS.getStrCouleurPerso() != null ? HS.getStrCouleurPerso().replace(";", "&pv") : "")
4607 + ";nomIconeSource:" + (HS.getStrNomIconeSource() != null ? HS.getStrNomIconeSource() : "")
4608 + "]\n";
4609 }
4610 for (int j = 0; j < getPanoramiquesProjet()[i].getiNombreHotspotDiapo(); j++) {
4612 strContenuFichier += " [hotspotDiapo==>"
4613 + "longitude:" + HS.getLongitude()
4614 + ";latitude:" + HS.getLatitude()
4615 + ";numDiapo:" + HS.getiNumDiapo()
4616 + ";info:" + HS.getStrInfo().replace(";", "&pv").replace(":", "&dp")
4617 + ";anime:" + HS.isbAnime()
4618 + "]\n";
4619 }
4620 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotHTML(); j++) {
4622 strContenuFichier += " [hotspotHTML==>"
4623 + "longitude:" + HS.getLongitude()
4624 + ";latitude:" + HS.getLatitude()
4625 + ";lienExterieur:" + HS.isbLienExterieur()
4626 + ";url:" + HS.getStrURLExterieure()
4627 + ";info:" + HS.getStrInfo().replace(";", "&pv").replace(":", "&dp")
4628 + ";typeAnimation:" + HS.getStrTypeAnimation()
4629 + ";agranditSurvol:" + HS.isAgranditSurvol()
4630 + ";position:" + HS.getStrPositionHTML()
4631 + ";couleur:" + HS.getStrCouleurHTML()
4632 + ";opacite:" + HS.getOpaciteHTML()
4633 + ";largeur:" + HS.getLargeurHTML()
4634 + ";couleurPerso:" + (HS.getStrCouleurPerso() != null ? HS.getStrCouleurPerso().replace(";", "&pv") : "")
4635 + ";nomIconeSource:" + (HS.getStrNomIconeSource() != null ? HS.getStrNomIconeSource() : "")
4636 + "]\n";
4637 }
4638 }
4639 for (int i = 0; i < getiNombreDiapo(); i++) {
4640 strContenuFichier += "[Diaporama=>"
4641 + "nom:" + diaporamas[i].getStrNomDiaporama()
4642 + ";fichier:" + diaporamas[i].getStrFichierDiaporama()
4643 + ";opacite:" + diaporamas[i].getOpaciteDiaporama()
4644 + ";nbImages:" + diaporamas[i].getiNombreImages()
4645 + ";delai:" + diaporamas[i].getDelaiDiaporama()
4647 + "]\n";
4648 for (int j = 0; j < diaporamas[i].getiNombreImages(); j++) {
4649 strContenuFichier += " [imageDiapo==>"
4650 + "fichierImage:" + diaporamas[i].getStrFichiersImage(j)
4651 + ";fichiers:" + diaporamas[i].getStrFichiers(j)
4652 + ";libelles:" + diaporamas[i].getStrLibellesImages(j).replace("\n", "");
4653 strContenuFichier += "]\n";
4654 }
4655 }
4656
4657 strContenuFichier += "[Interface=>\n" + getGestionnaireInterface().strGetTemplate() + "]\n";
4659 for (int i = 0; i < getiNombrePanoramiques(); i++) {
4660 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotHTML(); j++) {
4661 if (!panoramiquesProjet[i].getHotspotHTML(j).isbLienExterieur()) {
4664 += "[pageHTML=>"
4665 + "numPano:" + i + "\n"
4666 + "numHSHTML:" + j + "\n"
4667 + "texteHTML:" + HS.getStrTexteHTML().replace("\n", "&nl").replace(":", "&dp").replace(";", "&pv") + "\n"
4668 + "numImages:" + HS.getiNombreImages() + "\n";
4669 for (int k = 0; k < HS.getiNombreImages(); k++) {
4671 += "imagePath:" + HS.getImagesEditeur()[k].getStrImagePath() + "\n";
4672
4673 }
4674 strContenuFichier += "]\n";
4675 }
4676 }
4677 }
4678 fileProjet.setWritable(true);
4682 }
4683 Alert alert = new Alert(AlertType.INFORMATION);
4684 alert.setTitle(rbLocalisation.getString("main.dialog.sauveProjet"));
4685 alert.setHeaderText(null);
4686 alert.setContentText(rbLocalisation.getString("main.dialog.sauveProjetMessage"));
4687 alert.showAndWait();
4688 }
4689
4694 private static void sauveHistoFichiers() throws IOException {
4695 File fileFichConfig = new File(EditeurPanovisu.fileRepertConfig.getAbsolutePath() + File.separator + "derniersprojets.cfg");
4696 if (!fileFichConfig.exists()) {
4697 fileFichConfig.createNewFile();
4698 }
4699 fileFichConfig.setWritable(true);
4701 for (int i = 0; i < nombreHistoFichiers; i++) {
4703 }
4705 try {
4707
4708 } catch (IOException ex) {
4709 Logger.getLogger(ConfigDialogController.class
4710 .getName()).log(Level.SEVERE, null, ex);
4711 }
4713 try {
4715
4716 } catch (IOException ex) {
4717 Logger.getLogger(ConfigDialogController.class
4718 .getName()).log(Level.SEVERE, null, ex);
4719 }
4720 try {
4721 bwFichierHisto.close();
4722
4723 } catch (IOException ex) {
4724 Logger.getLogger(ConfigDialogController.class
4725 .getName()).log(Level.SEVERE, null, ex);
4726 }
4727
4728 }
4729
4734 private static void projetSauve() throws IOException {
4735 if (!bRepertSauveChoisi) {
4737 }
4738 if (fileProjet == null) {
4740 FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("fichier panoVisu (*.pvu)", "*.pvu");
4741 fcRepertChoix.getExtensionFilters().add(extFilter);
4742 File repert = new File(getStrRepertoireProjet() + File.separator);
4743 fcRepertChoix.setInitialDirectory(repert);
4744 fileProjet = fcRepertChoix.showSaveDialog(null);
4745
4746 }
4747 if (fileProjet != null) {
4749 ajouteFichierHisto(fileProjet.getAbsolutePath());
4750 }
4751 }
4752
4757 private static void projetSauveSous() throws IOException {
4758 if (!bRepertSauveChoisi) {
4760 }
4762 FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("fichier panoVisu (*.pvu)", "*.pvu");
4763 fcRepertChoix.getExtensionFilters().add(extFilter);
4764 File fileRepert = new File(getStrRepertoireProjet() + File.separator);
4765 fcRepertChoix.setInitialDirectory(fileRepert);
4766 fileProjet = fcRepertChoix.showSaveDialog(null);
4767 if (fileProjet != null) {
4769 ajouteFichierHisto(fileProjet.getAbsolutePath());
4770
4771 }
4772
4773 }
4774
4778 private static void aideapropos() {
4779 try {
4781
4782 } catch (Exception ex) {
4783 Logger.getLogger(EditeurPanovisu.class
4784 .getName()).log(Level.SEVERE, null, ex);
4785 }
4786 }
4787
4792 @SuppressWarnings("unused")
4794 try {
4796 } catch (IOException ex) {
4797 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
4798 }
4799
4800 ButtonType reponse = null;
4801 ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
4802 ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
4803 ButtonType buttonTypeAnnule = new ButtonType(rbLocalisation.getString("main.annuler"));
4804 if (!isbDejaSauve()) {
4805 Alert alert = new Alert(AlertType.CONFIRMATION);
4806 alert.setTitle(rbLocalisation.getString("main.dialog.quitterApplication"));
4807 alert.setHeaderText(null);
4808 alert.setContentText(rbLocalisation.getString("main.dialog.chargeProjetMessage"));
4809 alert.getButtonTypes().clear();
4810 alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon, buttonTypeAnnule);
4811 @SuppressWarnings("unused")
4812 Optional<ButtonType> actReponse = alert.showAndWait();
4813 }
4814 if (reponse == buttonTypeOui) {
4815 try {
4816 projetSauve();
4817
4818 } catch (IOException ex) {
4819 Logger.getLogger(EditeurPanovisu.class
4820 .getName()).log(Level.SEVERE, null, ex);
4821 }
4822 }
4823 if ((reponse == buttonTypeOui) || (reponse == buttonTypeNon) || (reponse == null)) {
4825
4826 // Arrêter le serveur HTTP pour libérer le port
4827 try {
4829 System.out.println("✅ Serveur HTTP arrêté lors de la fermeture de l'application");
4830 } catch (Exception ex) {
4831 System.err.println("⚠️ Erreur lors de l'arrêt du serveur HTTP : " + ex.getMessage());
4832 }
4833
4836 fileTemp.delete();
4837 Platform.exit();
4838 }
4839 }
4840
4844 private static void projetsNouveau() {
4845 ButtonType reponse = null;
4846 ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
4847 ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
4848 ButtonType buttonTypeAnnule = new ButtonType(rbLocalisation.getString("main.annuler"));
4849 if (!isbDejaSauve()) {
4850 Alert alert = new Alert(AlertType.CONFIRMATION);
4851 alert.setTitle(rbLocalisation.getString("main.dialog.nouveauProjet"));
4852 alert.setHeaderText(null);
4853 alert.setContentText(rbLocalisation.getString("main.dialog.chargeProjetMessage"));
4854 alert.getButtonTypes().clear();
4855 alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon, buttonTypeAnnule);
4856 Optional<ButtonType> actReponse = alert.showAndWait();
4857 reponse = actReponse.get();
4858 }
4859 if (reponse == buttonTypeOui) {
4860 try {
4861 projetSauve();
4862
4863 } catch (IOException ex) {
4864 Logger.getLogger(EditeurPanovisu.class
4865 .getName()).log(Level.SEVERE, null, ex);
4866 }
4867 }
4868 if ((reponse == buttonTypeOui) || (reponse == buttonTypeNon) || (reponse == null)) {
4869 // 🔄 RÉINITIALISATION COMPLÈTE : Nettoyer toutes les données du projet précédent
4871
4872 apVignettesPano.getChildren().clear();
4873 strPanoEntree = "";
4877 fileRptPanovisu.mkdirs();
4878 copieRepertoire(getStrRepertAppli() + File.separator + "panovisu", strRepertPanovisu);
4879 mnuPanoramique.setDisable(false);
4880 btnMnuPanoramique.setDisable(false);
4881
4882 ivAjouterPano.setDisable(false);
4883 ivAjouterPano.setOpacity(1.0);
4884 ivSauveProjet.setDisable(false);
4885 ivSauveProjet.setOpacity(1.0);
4886 mniSauveProjet.setDisable(false);
4887 mniSauveSousProjet.setDisable(false);
4888 mniVisiteGenere.setDisable(false);
4889 mniCreerZipVisite.setDisable(false);
4890
4891 fileProjet = null;
4892 getVbChoixPanoramique().setVisible(false);
4893 // setPanoramiquesProjet, setiNombrePanoramiques, setiNumPoints, etc. déjà faits dans reinitialiserProjet()
4895 dejaCharge = false;
4900 // ivImagePanoramique.setImage(null) et cbListeChoixPanoramique.getItems().clear() déjà faits dans reinitialiserProjet()
4901 lblDragDrop.setVisible(true);
4902 Node nodAncienNord = (Node) panePanoramique.lookup("#Nord");
4903 if (nodAncienNord != null) {
4904 panePanoramique.getChildren().remove(nodAncienNord);
4905 }
4906 Node nodAncienPoV = (Node) panePanoramique.lookup("#PoV");
4907 if (nodAncienPoV != null) {
4908 panePanoramique.getChildren().remove(nodAncienPoV);
4909 }
4910
4911 getGestionnairePlan().getLblDragDropPlan().setVisible(true);
4912 // setiNombrePlans(0) et setPlans déjà faits dans reinitialiserProjet()
4915 getMniAffichagePlan().setDisable(true);
4916 getTabPlan().setDisable(true);
4917 getTabPlan().setContent(panePanneauPlan);
4918 spVuePanoramique.setOnDragOver((DragEvent event) -> {
4919 Dragboard dbFichiersPanoramiques = event.getDragboard();
4920 if (dbFichiersPanoramiques.hasFiles()) {
4921 event.acceptTransferModes(TransferMode.ANY);
4922 } else {
4923 event.consume();
4924 }
4925 });
4926 spVuePanoramique.setOnDragDropped((DragEvent event) -> {
4927 Platform.runLater(() -> {
4928 getApAttends().setVisible(true);
4929 });
4930 Dragboard dbFichiersPanoramiques = event.getDragboard();
4931 boolean bSucces = false;
4932 if (dbFichiersPanoramiques.hasFiles()) {
4933 getApAttends().setVisible(true);
4934 mbarPrincipal.setDisable(true);
4935 bbarPrincipal.setDisable(true);
4936 hbBarreBouton.setDisable(true);
4937 tpEnvironnement.setDisable(true);
4938 pbarAvanceChargement.setProgress(-1);
4939 bSucces = true;
4940 @SuppressWarnings("unused")
4941 String strFichierPath = null;
4942 File[] fileList = new File[100];
4943 int i = 0;
4944 for (File filePano : dbFichiersPanoramiques.getFiles()) {
4945 strFichierPath = filePano.getAbsolutePath();
4946 fileList[i] = filePano;
4947 i++;
4948 }
4949 int iNb = i;
4950 if (fileList != null) {
4951 lblDragDrop.setVisible(false);
4952 @SuppressWarnings("rawtypes")
4956 thChargeFichiers.setDaemon(true);
4957 thChargeFichiers.start();
4958 }
4959
4960 }
4961 event.setDropCompleted(bSucces);
4962 event.consume();
4963 });
4964 apVignettesPano.getChildren().add(rectVignettePano);
4965 rectVignettePano.setVisible(false);
4966 }
4967 }
4968
4975 String strChaine = "";
4976 String strChaine1 = "abcdefghijklmnopqrstuvwxyz0123456789";
4977 for (int i = 0; i < iNombre; i++) {
4978 int iNumChar = (int) (Math.random() * 36.0f);
4979 strChaine += strChaine1.substring(iNumChar, iNumChar + 1);
4980 }
4981 return strChaine;
4982 }
4983
5004 if (path.exists()) {
5005 File[] fileFichiers = path.listFiles();
5006 for (File fileFichier : fileFichiers) {
5007 if (fileFichier.isDirectory()) {
5008 deleteDirectory(fileFichier.getAbsolutePath());
5009 }
5010 fileFichier.delete();
5011 }
5012 }
5013 }
5014
5030 @SuppressWarnings({ "unchecked", "unused" })
5031 public static void rafraichitListePano() {
5032 apVignettesPano.getChildren().clear();
5033 cbListeChoixPanoramique.getItems().clear();
5034 for (int i = 0; i < getiNombrePanoramiques(); i++) {
5036 String strNomPano = strFichierPano.substring(strFichierPano.lastIndexOf(File.separator) + 1, strFichierPano.length());
5037 cbListeChoixPanoramique.getItems().add(strNomPano);
5038 }
5039 for (int ii = 0; ii < ordPano.getStrPanos().size(); ii++) {
5040 int i = Integer.parseInt(ordPano.getStrPanos().get(ii));
5041 ImageView ivVignettePano = new ImageView(getPanoramiquesProjet()[i].getImgPanoRect());
5042 ivVignettePano.setPreserveRatio(true);
5043 ivVignettePano.setFitWidth(iLargeurVignettes);
5044 ivVignettePano.setLayoutX(5);
5045 ivVignettePano.setLayoutY((iLargeurVignettes / 2 + 10) * ii + 10);
5046 ivVignettePano.setCursor(Cursor.HAND);
5047 int iNumero = i;
5048 ivVignettePano.setOnMouseClicked((e) -> {
5050 });
5051 ivVignettePano.setOnMouseDragEntered((e) -> {
5052 ivVignettePano.setLayoutX(3);
5053 ivVignettePano.setStyle(
5054 "-fx-border-color : #fff;"
5055 + "-fx-border-width : 2px;"
5056 + "-fx-border-style :solid;");
5057 });
5058 ivVignettePano.setOnMouseDragExited((e) -> {
5059 ivVignettePano.setLayoutX(5);
5060 ivVignettePano.setStyle(
5061 "-fx-border-color : rgba(0,0,0,0);"
5062 + "-fx-border-width : 0px;"
5063 + "-fx-border-style :none;");
5064 });
5065 apVignettesPano.getChildren().add(ivVignettePano);
5066 }
5067 int iPano = -1;
5068 int ii = 0;
5070 if (Integer.parseInt(stNumPano) == getiPanoActuel()) {
5071 iPano = ii;
5072 }
5073 ii++;
5074 }
5075
5076 if (iPano >= 0) {
5077 rectVignettePano.setLayoutY((iLargeurVignettes / 2 + 10) * iPano + 10);
5078 rectVignettePano.setVisible(true);
5079 apVignettesPano.getChildren().add(rectVignettePano);
5080 }
5081
5082 // Vérifier que la liste n'est pas vide et que l'index est valide
5083 if (!cbListeChoixPanoramique.getItems().isEmpty() &&
5084 getiPanoActuel() >= 0 &&
5085 getiPanoActuel() < cbListeChoixPanoramique.getItems().size()) {
5087 }
5088 }
5089
5091 while (strChaine.length() >= 0 && strChaine.endsWith(" ")) {
5092 strChaine = strChaine.substring(0, strChaine.length() - 1);
5093
5094 }
5095 return strChaine;
5096 }
5097
5098 static String[] strEncode = {"&lbrack", "&rbrack", "&pv", "&sp"};
5099 static String[] strDecode = {"[", "]", ";", " "};
5100
5102 for (int i = 0; i < strEncode.length; i++) {
5104 }
5105 return strFichier;
5106 }
5107
5109 for (int i = 0; i < strEncode.length; i++) {
5111 }
5112 return strFichier;
5113 }
5114
5120 @SuppressWarnings("rawtypes")
5122 return new Task() {
5123 @Override
5124 protected Object call() throws Exception {
5125
5126 strPanoEntree = "";
5127 strOrdrePanos = "";
5129 String strLigneComplete = strLigComplete.replace("[", "|");
5130 String strLignes[] = strLigneComplete.split("\\|", 500);
5134 int iNbHS = 0;
5135 int iNbImg = 0;
5136 int iNbHTML = 0;
5137 int iNbHSDiapo = 0;
5138 int iNbHsplan = 0;
5139 int iNbImages = 0;
5140 setiNombrePlans(-1);
5141 for (int ikk = 1; ikk < strLignes.length; ikk++) {
5143 strElementsLigne = strLigne.split(";", 25);
5144 strTypeElement = strElementsLigne[0].split(">", 2);
5145 strTypeElement[0] = strTypeElement[0].replace(" ", "").replace("=", "").replace("[", "");
5147 if ("Panoramique".equals(strTypeElement[0])) {
5148 for (int i = 0; i < strElementsLigne.length; i++) {
5149 strElementsLigne[i] = strElementsLigne[i].replace("]", "").replace("\n", "");
5150 String[] strValeur = strElementsLigne[i].split(":", 2);
5151 if (strValeur.length == 1) {
5152 strValeur[1] = "";
5153 }
5154 switch (strValeur[0]) {
5155 case "fichier":
5157 File fileImgPano = new File(nmFich);
5158 if (!fileImgPano.exists()) {
5159 fileImgPano = new File(getStrRepertAppli() + File.separator + "images" + File.separator + "pasImage.jpg");
5160 }
5161 int iNumPano = getiNombrePanoramiques() + 1;
5162 Platform.runLater(() -> {
5163 lblCharge.setText("pano " + iNumPano + "/" + getiNombrePanoramiquesFichier() + " : " + nmFich);
5164 lblNiveaux.setText("");
5165 pbarAvanceChargement.setProgress((double) (iNumPano - 1) / (double) getiNombrePanoramiquesFichier());
5166 });
5167 File fileImageRepert = new File(getStrRepertTemp() + File.separator + "panos");
5168
5169 if (!fileImageRepert.exists()) {
5170 fileImageRepert.mkdirs();
5171 }
5172 setStrRepertPanos(fileImageRepert.getAbsolutePath());
5173 String strFichierPano = fileImgPano.getPath();
5174 String strExtension = strFichierPano.substring(strFichierPano.length() - 3, strFichierPano.length());
5175 Image imgPano = null;
5176 if ("tif".equals(strExtension)) {
5177 try {
5179
5180 } catch (IOException ex) {
5181 Logger.getLogger(EditeurPanovisu.class
5182 .getName()).log(Level.SEVERE, null, ex);
5183 }
5184 } else {
5185 imgPano = new Image("file:" + strFichierPano);
5186 }
5187 if (imgPano != null) {
5188 if (imgPano.getWidth() == imgPano.getHeight()) {
5190
5191 } else {
5193 }
5194 }
5195 break;
5196
5197 case "titre":
5198 if (!strValeur[1].equals("null")) {
5200 } else {
5202 }
5203 break;
5204 case "type":
5206 break;
5207 case "afficheInfo":
5209 break;
5210 case "afficheTitre":
5212 break;
5213 case "affDescription":
5215 break;
5216 case "nb":
5217 iNbHS = Integer.parseInt(strValeur[1]);
5218 break;
5219 case "nbImg":
5220 iNbImg = Integer.parseInt(strValeur[1]);
5221 break;
5222 case "nbHTML":
5223 iNbHTML = Integer.parseInt(strValeur[1]);
5224 break;
5225 case "nbDiapo":
5226 iNbHSDiapo = Integer.parseInt(strValeur[1]);
5227 break;
5228 case "regardX":
5230 break;
5231 case "regardY":
5233 break;
5234 case "minLat":
5236 break;
5237 case "maxLat":
5239 break;
5240 case "bMinLat":
5242 break;
5243 case "bMaxLat":
5245 break;
5246 case "fov":
5248 break;
5249 case "minfov":
5251 break;
5252 case "maxfov":
5254 break;
5255 case "zeroNord":
5257 break;
5258 case "numeroPlan":
5259 getPanoramiquesProjet()[getiPanoActuel()].setNumeroPlan(Integer.parseInt(strValeur[1].replace(" ", "")));
5260 break;
5261 case "longitudeGeo":
5264 break;
5265 case "latitudeGeo":
5267 break;
5268
5269 case "descriptionIA":
5270 String strDescIA = strValeur[1].replace("&pv", ";").replace("&dp", ":").replace("&nl", "\n");
5272 break;
5273
5274 case "affichePlan":
5276 break;
5277 default:
5278 break;
5279 }
5280 }
5281 for (int jj = 0; jj < iNbHS; jj++) {
5282 ikk++;
5284 strElementsLigne = strLigne.split(";", 15);
5285 strTypeElement = strElementsLigne[0].split(">", 2);
5286 strTypeElement[0] = strTypeElement[0].replace(" ", "").replace("=", "").replace("[", "");
5288 HotSpot HS = new HotSpot();
5289 for (int i = 0; i < strElementsLigne.length; i++) {
5290 strElementsLigne[i] = strElementsLigne[i].replace("]", "");
5291 String[] strValeur = strElementsLigne[i].split(":", 2);
5292 if (strValeur.length == 1) {
5293 strValeur = new String[]{strValeur[0], ""};
5294 }
5295
5296 switch (strValeur[0]) {
5297 case "longitude":
5298 HS.setLongitude(Double.parseDouble(strValeur[1]));
5299 break;
5300 case "latitude":
5301 HS.setLatitude(Double.parseDouble(strValeur[1]));
5302 break;
5303 case "regardX":
5304 HS.setRegardX(Double.parseDouble(strValeur[1]));
5305 break;
5306 case "regardY":
5307 HS.setRegardY(Double.parseDouble(strValeur[1]));
5308 break;
5309 case "champVisuel":
5310 HS.setChampVisuel(Double.parseDouble(strValeur[1]) / 2.0);
5311 break;
5312 case "image":
5313 if ("null".equals(strValeur[1])) {
5314 HS.setStrFichierImage(null);
5315 } else {
5316 HS.setStrFichierImage(strValeur[1]);
5317 }
5318 break;
5319 case "info":
5320 if ("null".equals(strValeur[1])) {
5321 HS.setStrInfo(null);
5322 } else {
5323 HS.setStrInfo(strValeur[1].replace("&pv", ";").replace("&dp", ":").replace("&ds", "#"));
5324 }
5325 break;
5326 case "xml":
5327 if ("null".equals(strValeur[1])) {
5328 HS.setStrFichierXML(null);
5329 } else {
5330 HS.setStrFichierXML(strValeur[1]);
5331 }
5332 break;
5333 case "numXML":
5334 HS.setNumeroPano(Integer.parseInt(strValeur[1]));
5335 break;
5336 case "typeAnimation":
5337 HS.setStrTypeAnimation(strValeur[1]);
5338 break;
5339 case "anime":
5340 // Compatibilité avec l'ancien format
5341 HS.setAnime(strValeur[1].equals("true"));
5342 break;
5343 case "agranditSurvol":
5344 HS.setAgranditSurvol(strValeur[1].equals("true"));
5345 break;
5346 case "couleurPerso":
5347 HS.setStrCouleurPerso(strValeur[1].replace("&pv", ";"));
5348 break;
5349 case "nomIconeSource":
5350 HS.setStrNomIconeSource(strValeur[1]);
5351 break;
5352 }
5353 }
5355
5356 // Reconstruire l'icône si couleur personnalisée OU icône source personnalisée
5357 if ((HS.getStrCouleurPerso() != null && !HS.getStrCouleurPerso().isEmpty()) ||
5358 (HS.getStrNomIconeSource() != null && !HS.getStrNomIconeSource().isEmpty())) {
5359 String nomIconeAUtiliser = (HS.getStrNomIconeSource() != null && !HS.getStrNomIconeSource().isEmpty())
5360 ? HS.getStrNomIconeSource()
5361 : strNomfichierHS;
5363 }
5364 }
5365
5366 for (int jj = 0; jj < iNbImg; jj++) {
5367 ikk++;
5369 strElementsLigne = strLigne.split(";", 15);
5370 strTypeElement = strElementsLigne[0].split(">", 2);
5371 strTypeElement[0] = strTypeElement[0].replace(" ", "").replace("=", "").replace("[", "");
5374 for (int i = 0; i < strElementsLigne.length; i++) {
5375 strElementsLigne[i] = strElementsLigne[i].replace("]", "");
5376 String[] strValeur = strElementsLigne[i].split(":", 2);
5377 if (strValeur.length == 1) {
5378 strValeur = new String[]{strValeur[0], ""};
5379 }
5380
5381 switch (strValeur[0]) {
5382 case "longitude":
5383 HS.setLongitude(Double.parseDouble(strValeur[1]));
5384 break;
5385 case "latitude":
5386 HS.setLatitude(Double.parseDouble(strValeur[1]));
5387 break;
5388 case "image":
5389 if ("null".equals(strValeur[1])) {
5390 HS.setStrFichierImage(null);
5391 } else {
5392 HS.setStrFichierImage(strValeur[1]);
5393 }
5394 break;
5395 case "couleur":
5396 if ("null".equals(strValeur[1])) {
5397 HS.setStrCouleurFond("");
5398 } else {
5399 HS.setStrCouleurFond(strValeur[1]);
5400 }
5401 break;
5402 case "opacite":
5403 if ("null".equals(strValeur[1])) {
5404 HS.setOpacite(-1);
5405 } else {
5406 HS.setOpacite(Double.parseDouble(strValeur[1]));
5407 }
5408 break;
5409 case "info":
5410 if ("null".equals(strValeur[1])) {
5411 HS.setStrInfo(null);
5412 } else {
5413 HS.setStrInfo(strValeur[1].replace("&pv", ";").replace("&dp", ":").replace("&ds", "#"));
5414 }
5415 break;
5416 case "img":
5417 if ("null".equals(strValeur[1])) {
5418 HS.setStrLienImg(null);
5419 } else {
5420 HS.setStrLienImg(strValeur[1]);
5421 }
5422 break;
5423 case "urlImg":
5424 if ("null".equals(strValeur[1])) {
5425 HS.setStrUrlImage(null);
5426 } else {
5427 HS.setStrUrlImage(strValeur[1]);
5428 }
5429 String nmFich = strValeur[1];
5430 File imgPano = new File(nmFich);
5431 File imageRepert = new File(getStrRepertTemp() + File.separator + "images");
5432 if (!imageRepert.exists()) {
5433 imageRepert.mkdirs();
5434 }
5435 setStrRepertPanos(imageRepert.getAbsolutePath());
5436 try {
5437 if (imgPano.exists()) {
5439 } else {
5440 String strExtension = imgPano.getPath().substring(imgPano.getPath().lastIndexOf(".") + 1);
5444 + "images"
5446 + "imagePasTrouvee."
5447 + strExtension;
5449 String strFich = imgPano.getPath().substring(imgPano.getPath().lastIndexOf(File.separator));
5451 + File.separator
5452 + "images"
5453 + File.separator
5454 + "imagePasTrouvee."
5455 + strExtension);
5456 File fNouvFichier = new File(
5458 + File.separator
5459 + "images"
5460 + File.separator
5461 + strFich
5462 );
5463 fFichier.renameTo(fNouvFichier);
5464 }
5465 } catch (IOException ex) {
5466 Logger.getLogger(EditeurPanovisu.class
5467 .getName()).log(Level.SEVERE, null, ex);
5468 }
5469
5470 break;
5471 case "typeAnimation":
5472 HS.setStrTypeAnimation(strValeur[1]);
5473 break;
5474 case "anime":
5475 // Compatibilité avec l'ancien format
5476 HS.setAnime(strValeur[1].equals("true"));
5477 break;
5478 case "agranditSurvol":
5479 HS.setAgranditSurvol(strValeur[1].equals("true"));
5480 break;
5481 case "couleurPerso":
5482 HS.setStrCouleurPerso(strValeur[1].replace("&pv", ";"));
5483 break;
5484 case "nomIconeSource":
5485 HS.setStrNomIconeSource(strValeur[1]);
5486 break;
5487 }
5488 }
5490
5491 // Reconstruire l'icône si couleur personnalisée OU icône source personnalisée
5492 if ((HS.getStrCouleurPerso() != null && !HS.getStrCouleurPerso().isEmpty()) ||
5493 (HS.getStrNomIconeSource() != null && !HS.getStrNomIconeSource().isEmpty())) {
5494 String nomIconeAUtiliser = (HS.getStrNomIconeSource() != null && !HS.getStrNomIconeSource().isEmpty())
5495 ? HS.getStrNomIconeSource()
5496 : strNomfichierHSImage;
5497 reconstruireIconeHotspot(HS, getiPanoActuel(), getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotImage() - 1, "hsImage", nomIconeAUtiliser);
5498 }
5499 }
5500 for (int jj = 0; jj < iNbHSDiapo; jj++) {
5501 ikk++;
5503 strElementsLigne = strLigne.split(";", 13);
5504 strTypeElement = strElementsLigne[0].split(">", 2);
5505 strTypeElement[0] = strTypeElement[0].replace(" ", "").replace("=", "").replace("[", "");
5508 for (int i = 0; i < strElementsLigne.length; i++) {
5509 strElementsLigne[i] = strElementsLigne[i].replace("]", "");
5510 String[] strValeur = strElementsLigne[i].split(":", 2);
5511 switch (strValeur[0]) {
5512 case "longitude":
5513 HS.setLongitude(Double.parseDouble(strValeur[1]));
5514 break;
5515 case "latitude":
5516 HS.setLatitude(Double.parseDouble(strValeur[1]));
5517 break;
5518 case "info":
5519 if ("null".equals(strValeur[1])) {
5520 HS.setStrInfo(null);
5521 } else {
5522 HS.setStrInfo(strValeur[1].replace("&pv", ";").replace("&dp", ":").replace("&ds", "#"));
5523 }
5524 break;
5525 case "numDiapo":
5526 HS.setiNumDiapo(Integer.parseInt(strValeur[1]));
5527 break;
5528 case "anime":
5529 HS.setbAnime(strValeur[1].equals("true"));
5530 break;
5531 }
5532 }
5534 }
5535
5536 for (int jj = 0; jj < iNbHTML; jj++) {
5537 ikk++;
5539 strElementsLigne = strLigne.split(";", 15);
5540 strTypeElement = strElementsLigne[0].split(">", 2);
5541 strTypeElement[0] = strTypeElement[0].replace(" ", "").replace("=", "").replace("[", "");
5543 HotspotHTML HS = new HotspotHTML();
5544 for (int i = 0; i < strElementsLigne.length; i++) {
5545 strElementsLigne[i] = strElementsLigne[i].replace("]", "");
5546 String[] strValeur = strElementsLigne[i].split(":", 2);
5547 if (strValeur.length == 1) {
5548 strValeur = new String[]{strValeur[0], ""};
5549 }
5550
5551 switch (strValeur[0]) {
5552 case "longitude":
5553 HS.setLongitude(Double.parseDouble(strValeur[1]));
5554 break;
5555 case "latitude":
5556 HS.setLatitude(Double.parseDouble(strValeur[1]));
5557 break;
5558 case "lienExterieur":
5559 HS.setbLienExterieur(strValeur[1].equals("true"));
5560 break;
5561 case "url":
5562 HS.setStrURLExterieure(strValeur[1]);
5563 break;
5564
5565 case "info":
5566 if ("null".equals(strValeur[1])) {
5567 HS.setStrInfo(null);
5568 } else {
5569 HS.setStrInfo(strValeur[1].replace("&pv", ";").replace("&dp", ":").replace("&ds", "#"));
5570 }
5571 break;
5572 case "typeAnimation":
5573 HS.setStrTypeAnimation(strValeur[1]);
5574 break;
5575 case "anime":
5576 // Compatibilité avec l'ancien format
5577 HS.setAnime(strValeur[1].equals("true"));
5578 break;
5579 case "agranditSurvol":
5580 HS.setAgranditSurvol(strValeur[1].equals("true"));
5581 break;
5582 case "position":
5583 HS.setStrPositionHTML(strValeur[1]);
5584 break;
5585 case "couleur":
5586 HS.setStrCouleurHTML(strValeur[1]);
5587 break;
5588 case "opacite":
5589 HS.setOpaciteHTML(Double.parseDouble(strValeur[1]));
5590 break;
5591 case "largeur":
5592 HS.setLargeurHTML(Double.parseDouble(strValeur[1]));
5593 break;
5594 case "couleurPerso":
5595 HS.setStrCouleurPerso(strValeur[1].replace("&pv", ";"));
5596 break;
5597 case "nomIconeSource":
5598 HS.setStrNomIconeSource(strValeur[1]);
5599 break;
5600
5601 }
5602 }
5604
5605 // Reconstruire l'icône si couleur personnalisée OU icône source personnalisée
5606 if ((HS.getStrCouleurPerso() != null && !HS.getStrCouleurPerso().isEmpty()) ||
5607 (HS.getStrNomIconeSource() != null && !HS.getStrNomIconeSource().isEmpty())) {
5608 String nomIconeAUtiliser = (HS.getStrNomIconeSource() != null && !HS.getStrNomIconeSource().isEmpty())
5609 ? HS.getStrNomIconeSource()
5610 : strNomfichierHSHTML;
5612 }
5613 }
5614
5615 }
5616 if ("Diaporama".equals(strTypeElement[0])) {
5618 for (int i = 0; i < strElementsLigne.length; i++) {
5619 strElementsLigne[i] = strElementsLigne[i].replace("]", "").replace("\n", "");
5620 String[] strValeur = strElementsLigne[i].split(":", 2);
5621 if (strValeur.length == 1) {
5622 strValeur[1] = "";
5623 }
5624 switch (strValeur[0]) {
5625 case "nom":
5627 break;
5628 case "fichier":
5629 if (!strValeur[1].equals("null")) {
5631 } else {
5633 }
5634 break;
5635 case "nbImages":
5636 iNbImages = Integer.parseInt(strValeur[1]);
5637 break;
5638 case "opacite":
5640 break;
5641 case "delai":
5643 break;
5644 case "coul":
5646 break;
5647 default:
5648 break;
5649 }
5650 }
5651 for (int jj = 0; jj < iNbImages; jj++) {
5652 ikk++;
5654 strElementsLigne = strLigne.split(";", 10);
5655 strTypeElement = strElementsLigne[0].split(">", 2);
5656 strTypeElement[0] = strTypeElement[0].replace(" ", "").replace("=", "").replace("[", "");
5658 for (int i = 0; i < strElementsLigne.length; i++) {
5659 strElementsLigne[i] = strElementsLigne[i].replace("]", "");
5660 String[] strValeur = strElementsLigne[i].split(":", 2);
5661 if (strValeur.length == 1) {
5662 strValeur[1] = "";
5663 }
5664 switch (strValeur[0]) {
5665 case "fichierImage":
5667 break;
5668 case "fichiers":
5670 break;
5671 case "libelles":
5673 break;
5674 }
5675 }
5677 }
5679 }
5680
5681 if ("Plan".equals(strTypeElement[0])) {
5682 for (int i = 0; i < strElementsLigne.length; i++) {
5683 strElementsLigne[i] = strElementsLigne[i].replace("]", "");
5684 String[] strValeur = strElementsLigne[i].split(":", 2);
5685 switch (strValeur[0]) {
5686 case "lienImage":
5688 getPlans()[getiNombrePlans()] = new Plan();
5690 File fileRepertoirePlan = new File(getStrRepertTemp() + File.separator + "images");
5691 if (!fileRepertoirePlan.exists()) {
5692 fileRepertoirePlan.mkdirs();
5693 }
5694 try {
5695 copieFichierRepertoire(getPlans()[getiNombrePlans()].getStrLienPlan(), fileRepertoirePlan.getAbsolutePath());
5696
5697 } catch (IOException ex) {
5698 Logger.getLogger(EditeurPanovisu.class
5699 .getName()).log(Level.SEVERE, null, ex);
5700 }
5701
5702 break;
5703 case "image":
5705 break;
5706 case "titre":
5707 if (!strValeur[1].equals("'null'")) {
5709 } else {
5711 }
5712 break;
5713 case "nb":
5714 iNbHsplan = Integer.parseInt(strValeur[1]);
5715 break;
5716 case "position":
5718 break;
5719 case "positionX":
5721 break;
5722 case "positionY":
5724 break;
5725 case "directionNord":
5727 break;
5728 default:
5729 break;
5730 }
5731 }
5732 for (int jj = 0; jj < iNbHsplan; jj++) {
5733 ikk++;
5735 strElementsLigne = strLigne.split(";", 15);
5736 strTypeElement = strElementsLigne[0].split(">", 2);
5737 strTypeElement[0] = strTypeElement[0].replace(" ", "").replace("=", "").replace("[", "");
5739 HotSpot HS = new HotSpot();
5740 for (int i = 0; i < strElementsLigne.length; i++) {
5741 strElementsLigne[i] = strElementsLigne[i].replace("]", "");
5742 String[] strValeur = strElementsLigne[i].split(":", 2);
5743 switch (strValeur[0]) {
5744 case "longitude":
5745 HS.setLongitude(Double.parseDouble(strValeur[1]));
5746 break;
5747 case "latitude":
5748 HS.setLatitude(Double.parseDouble(strValeur[1]));
5749 break;
5750 case "image":
5751 if ("null".equals(strValeur[1])) {
5752 HS.setStrFichierImage(null);
5753 } else {
5754 HS.setStrFichierImage(strValeur[1]);
5755 }
5756 break;
5757 case "info":
5758 if ("null".equals(strValeur[1])) {
5759 HS.setStrInfo(null);
5760 } else {
5761 HS.setStrInfo(strValeur[1]);
5762 }
5763 break;
5764 case "xml":
5765 if ("null".equals(strValeur[1])) {
5766 HS.setStrFichierXML(null);
5767 } else {
5768 HS.setStrFichierXML(strValeur[1]);
5769 }
5770 break;
5771 case "numeroPano":
5772 HS.setNumeroPano(Integer.parseInt(strValeur[1].replace("\n", "").replace(" ", "")));
5773 break;
5774 case "anime":
5775 HS.setAnime(strValeur[1].equals("true"));
5776 break;
5777 }
5778 }
5780 }
5781 }
5782 if ("Interface".equals(strTypeElement[0])) {
5783 String[] strElts = strElementsLigne[0].replace("]", "").split("\n");
5785 for (String strTexte : strElts) {
5786 if (!strTexte.equals("")) {
5788 }
5789 }
5791 }
5792 if ("PanoEntree".equals(strTypeElement[0])) {
5793 strPanoEntree = strElementsLigne[0].split("]")[0];
5794 }
5795 if ("introLP".equals(strTypeElement[0])) {
5797 }
5798 if ("arDemarre".equals(strTypeElement[0])) {
5800 }
5801 if ("arVitesse".equals(strTypeElement[0])) {
5802 setiAutoRotationVitesse(Integer.parseInt(strElementsLigne[0].split("]")[0]));
5803 }
5804 if ("atDemarre".equals(strTypeElement[0])) {
5806 }
5807 if ("atVitesse".equals(strTypeElement[0])) {
5808 setiAutoTourLimite(Integer.parseInt(strElementsLigne[0].split("]")[0]));
5809 }
5810 if ("atDemarrage".equals(strTypeElement[0])) {
5811 setiAutoTourDemarrage(Integer.parseInt(strElementsLigne[0].split("]")[0]));
5812 }
5813 if ("atType".equals(strTypeElement[0])) {
5815 }
5816 if ("OrdrePanos".equals(strTypeElement[0])) {
5817 strOrdrePanos = strElementsLigne[0].split("]")[0];
5818 }
5819 if ("titreVisite".equals(strTypeElement[0])) {
5820 strTitreVisite = strElementsLigne[0].split("]")[0];
5821 }
5822 if ("pageHTML".equals(strTypeElement[0])) {
5823 String[] strLignesCommande = strElementsLigne[0].split("]")[0].split("\n");
5824 int inPano = 0;
5825 int inHSHTML = 0;
5826 int inImage = 0;
5828 String strCommande = strLigneCommande.split(":", 2)[0];
5829 String strVal = strLigneCommande.split(":", 2)[1].replace("&nl", "\n").replace("&pv", ";").replace("&dp", ":");
5830 switch (strCommande) {
5831 case "numPano":
5832 inPano = Integer.parseInt(strVal);
5833 break;
5834 case "numHSHTML":
5835 inHSHTML = Integer.parseInt(strVal);
5836 break;
5837 case "texteHTML":
5839 break;
5840 case "imagePath":
5842 imageEdit.setStrImagePath(strVal);
5844 inImage++;
5846 break;
5847
5848 }
5849 }
5850 }
5851
5852 }
5853 for (int i = 0; i < getiNombreDiapo(); i++) {
5854 }
5855 return true;
5856 }
5857
5858 @SuppressWarnings("unchecked")
5859 @Override
5860
5877 protected void succeeded() {
5878 super.succeeded();
5879
5880 getVbChoixPanoramique().setVisible(true);
5882 if (getiNombrePlans() != 0) {
5883 int iNbPlans1 = getiNombrePlans();
5884 for (int i = 0; i < iNbPlans1; i++) {
5887 }
5889 }
5890 for (int i = 0; i < getiNombrePanoramiques(); i++) {
5891 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspots(); j++) {
5894 strFichPano = strFichPano.substring(strFichPano.lastIndexOf(File.separator) + 1, strFichPano.length()).split("\\.")[0] + ".xml";
5897 );
5898 } else {
5899 String strNomFichier = getPanoramiquesProjet()[i].getHotspot(j).getStrFichierXML().split("\\.")[0];
5900 for (int k = 0; k < getiNombrePanoramiques(); k++) {
5902 strFichPano = strFichPano.substring(strFichPano.lastIndexOf(File.separator) + 1, strFichPano.length()).split("\\.")[0];
5903 if (strFichPano.equals(strNomFichier)) {
5905 }
5906 }
5907 }
5908 }
5909 }
5910 for (int i = 0; i < getiNombreDiapo(); i++) {
5911 try {
5913 } catch (IOException ex) {
5914 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
5915 }
5916
5917 }
5918 try {
5920 setbDejaSauve(true);
5921
5922 } catch (IOException ex) {
5923 Logger.getLogger(EditeurPanovisu.class
5924 .getName()).log(Level.SEVERE, null, ex);
5925 }
5926 if (apListePanoTriable != null) {
5927 apParametresVisite.getChildren().remove(
5929 );
5930 }
5931 if (strOrdrePanos.equals((""))) {
5933 } else {
5935 }
5937 apListePanoTriable.setLayoutX(40);
5938 apListePanoTriable.setLayoutY(130);
5939 apListePanoTriable.setVisible(true);
5940 apParametresVisite.setPrefHeight(120 + apListePanoTriable.getPrefHeight() + 20);
5941 apParametresVisite.getChildren().add(
5943 );
5944 if (apParametresVisite.isVisible()) {
5945 apParametresVisite.setMinHeight(120 + apListePanoTriable.getPrefHeight() + 20);
5946 apParametresVisite.setMaxHeight(120 + apListePanoTriable.getPrefHeight() + 20);
5947 }
5949
5950 // Vérifier que la liste n'est pas vide avant d'accéder aux éléments
5951 if (!ordPano.getStrPanos().isEmpty()) {
5952 setiPanoActuel(Integer.parseInt(ordPano.getStrPanos().get(0)));
5955 bPanoCharge = true;
5956 getVbChoixPanoramique().setVisible(true);
5957
5958 if (!cbListeChoixPanoramique.getItems().isEmpty()) {
5959 cbListeChoixPanoramique.setValue(cbListeChoixPanoramique.getItems().get(0));
5960 }
5961 } else {
5962 // Aucun panoramique chargé
5963 System.out.println("⚠️ Aucun panoramique disponible dans la liste");
5964 bPanoCharge = false;
5965 }
5966
5967 TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
5968 if (tfVisite != null) {
5969 tfVisite.setText(strTitreVisite);
5970 }
5971 getApAttends().setVisible(false);
5972 mbarPrincipal.setDisable(false);
5973 bbarPrincipal.setDisable(false);
5974 hbBarreBouton.setDisable(false);
5975 tpEnvironnement.setDisable(false);
5976
5977 // Mettre à jour les couleurs des panneaux de hotspots selon le thème actuel
5979
5983 switch (getiAutoRotationVitesse()) {
5984 case 10:
5985 cbAutoRotationVitesse.getSelectionModel().select(0);
5986 break;
5987 case 20:
5988 cbAutoRotationVitesse.getSelectionModel().select(1);
5989 break;
5990 case 30:
5991 cbAutoRotationVitesse.getSelectionModel().select(2);
5992 break;
5993 default:
5994 cbAutoRotationVitesse.getSelectionModel().select(3);
5995 break;
5996 }
6000 switch (getStrAutoTourType()) {
6001 case "tours":
6002 cbAutoTourType.getSelectionModel().select(0);
6003 break;
6004 case "secondes":
6005 cbAutoTourType.getSelectionModel().select(1);
6006 break;
6007 }
6010 }
6011
6012 };
6013 }
6014
6015 private static void creeVignettesHS() {
6016 NavigateurPanoramique navigPano1 = new NavigateurPanoramique(getPanoramiquesProjet()[0].getImgVisuPanoramique(), 0, 0, 300, 150, false);
6017 AnchorPane apVisuPanoHS = new AnchorPane(navigPano1.affichePano());
6018 for (int i = 0; i < iNombrePanoramiques; i++) {
6019 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspots(); j++) {
6020 int iNumPanoChoisitHS = -1;
6021 if (!getPanoramiquesProjet()[i].getHotspot(j).getStrFichierXML().equals("")) {
6022 for (int ii1 = 0; ii1 < getiNombrePanoramiques(); ii1++) {
6024 String strNomXMLFile = strFichPano.substring(strFichPano.lastIndexOf(File.separator) + 1, strFichPano.length()).split("\\.")[0] + ".xml";
6025 if (strNomXMLFile.equals(getPanoramiquesProjet()[i].getHotspot(j).getStrFichierXML())) {
6027
6028 }
6029 }
6030
6032 navigPano1.setImagePanoramique("", img);
6033 navigPano1.setLongitude(getPanoramiquesProjet()[i].getHotspot(j).getRegardX());
6034 navigPano1.setLatitude(getPanoramiquesProjet()[i].getHotspot(j).getRegardY());
6035 navigPano1.setFov(getPanoramiquesProjet()[i].getHotspot(j).getChampVisuel());
6037 }
6038 }
6039 }
6040 apVisuPanoHS.setVisible(false);
6041 }
6042
6047 private static void lisFichierConfig() throws IOException {
6048 File fileFichierConfig = new File(fileRepertConfig.getAbsolutePath() + File.separator + "panovisu.cfg");
6049 if (fileFichierConfig.exists()) {
6050 try {
6053 new FileInputStream(fileFichierConfig), "UTF-8"))) {
6054 String strLangue = "fr";
6055 String strPays = "FR";
6057 String strAPI = "";
6058 while ((strTexte = FichierConfig.readLine()) != null) {
6059 String tpe = strTexte.split("=")[0];
6060 String valeur;
6061 if (strTexte.split("=").length > 1) {
6062 valeur = strTexte.split("=")[1];
6063 } else {
6064 valeur = "";
6065 }
6066 switch (tpe) {
6067 case "langue":
6068 strLangue = valeur;
6069 break;
6070 case "pays":
6071 strPays = valeur;
6072 break;
6073 case "repert":
6074 strRepert = valeur;
6075 break;
6076 case "bingAPIKey":
6077 strAPI = valeur;
6078 break;
6079 case "style":
6081 break;
6082
6083 }
6084
6085 }
6087 rbLocalisation = ResourceBundle.getBundle("editeurpanovisu.i18n.PanoVisu", getLocale());
6089 if (fileRepert1.exists()) {
6092 bRepertSauveChoisi = true;
6093 } else {
6096 }
6098 File f = new File("css/" + getStrStyleCSS() + ".css");
6099 getScnPrincipale().getStylesheets().add("file:///" + f.getAbsolutePath().replace("\\", "/"));
6100
6101 }
6102
6103 } catch (FileNotFoundException ex) {
6104 Logger.getLogger(EditeurPanovisu.class
6105 .getName()).log(Level.SEVERE, null, ex);
6106 }
6107 } else {
6108 fileFichierConfig.createNewFile();
6109 setLocale(new Locale("fr", "FR"));
6110 File f = new File("css/clair.css");
6111 getScnPrincipale().getStylesheets().add("file:///" + f.getAbsolutePath().replace("\\", "/"));
6113 String strContenuFichier = "langue=" + getLocale().toString().split("_")[0] + "\n";
6114 strContenuFichier += "pays=" + getLocale().toString().split("_")[1] + "\n";
6115 strContenuFichier += "repert=" + getStrRepertoireProjet() + "\n";
6116 strContenuFichier += "style=clair\n";
6117 fileFichierConfig.setWritable(true);
6119 try {
6121
6122 } catch (IOException ex) {
6123 Logger.getLogger(ConfigDialogController.class
6124 .getName()).log(Level.SEVERE, null, ex);
6125 }
6127 try {
6129
6130 } catch (IOException ex) {
6131 Logger.getLogger(ConfigDialogController.class
6132 .getName()).log(Level.SEVERE, null, ex);
6133 }
6134 try {
6135 bwFichierConfig.close();
6136
6137 } catch (IOException ex) {
6138 Logger.getLogger(ConfigDialogController.class
6139 .getName()).log(Level.SEVERE, null, ex);
6140 }
6141
6142 }
6143
6144 }
6145
6172 if (!fileRepert2.exists()) {
6173 fileRepert2.mkdirs();
6174 }
6176 if (filePath.exists()) {
6177 File[] fileFichiers = filePath.listFiles();
6178 for (File fileFichier : fileFichiers) {
6179 try {
6180 if (fileFichier.isDirectory()) {
6181 String strRep1 = fileFichier.getAbsolutePath().substring(fileFichier.getAbsolutePath().lastIndexOf(File.separator) + 1);
6183 copieRepertoire(fileFichier.getAbsolutePath(), strRep1);
6184 } else {
6186
6187 }
6188 } catch (IOException ex) {
6189 Logger.getLogger(EditeurPanovisu.class
6190 .getName()).log(Level.SEVERE, null, ex);
6191 }
6192 }
6193 }
6194 }
6195
6220 if (!fileFrom.exists()) {
6221 System.err.println("⚠️ Fichier source introuvable, copie ignorée : " + strFichier);
6222 return; // Ne pas lever d'exception, simplement ignorer
6223 }
6224 File fileTo = new File(strRepertoire + File.separator + strFichier.substring(strFichier.lastIndexOf(File.separator) + 1));
6225 Files.copy(fileFrom.toPath(), fileTo.toPath(), StandardCopyOption.REPLACE_EXISTING);
6226 }
6227
6231 private static void retireAffichageHotSpots() {
6232 Pane paneLabels = (Pane) vbVisuHotspots.lookup("#labels");
6233 vbVisuHotspots.getChildren().remove(paneLabels);
6234 dejaCharge = false;
6235 }
6236
6241 public static void rafraichitAffichageHotSpots() {
6242 if (getiNombrePanoramiques() > 0) {
6244 dejaCharge = false;
6246 paneAfficheHS1.setId("labels");
6247 vbVisuHotspots.getChildren().add(paneAfficheHS1);
6248 }
6249 }
6250
6254 private static void retireAffichagePointsHotSpots() {
6255 for (int i = 0; i < getiNumPoints(); i++) {
6256 Node nodePoint = (Node) panePanoramique.lookup("#point" + i);
6257 panePanoramique.getChildren().remove(nodePoint);
6258 }
6259 for (int i = 0; i < getiNumImages(); i++) {
6260 Node nodePoint = (Node) panePanoramique.lookup("#img" + i);
6261 panePanoramique.getChildren().remove(nodePoint);
6262 }
6263 for (int i = 0; i < getiNumHTML(); i++) {
6264 Node nodePoint = (Node) panePanoramique.lookup("#html" + i);
6265 panePanoramique.getChildren().remove(nodePoint);
6266 }
6267 for (int i = 0; i < getiNumDiapo(); i++) {
6268 Node nodePoint = (Node) panePanoramique.lookup("#dia" + i);
6269 panePanoramique.getChildren().remove(nodePoint);
6270 }
6271 }
6272
6279 private static String strListePano() {
6280 String strListe = "";
6281 if (getiNombrePanoramiques() == 0) {
6282 return null;
6283 } else {
6284 for (int i = 0; i < getiNombrePanoramiques(); i++) {
6286 String strNomPano = strFichierPano.substring(strFichierPano.lastIndexOf(File.separator) + 1, strFichierPano.length());
6287 String[] strNPano = strNomPano.split("\\.");
6288 strListe += strNPano[0];
6289 if (i < getiNombrePanoramiques() - 1) {
6290 strListe += ";";
6291 }
6292 }
6293 return strListe;
6294 }
6295 }
6296
6302 @SuppressWarnings("unused")
6304 final NavigateurPanoramique[] navigateurPano2Array = new NavigateurPanoramique[1]; // Tableau pour permettre modification dans lambda
6305 final AnchorPane[] apVisuPanoHSArray = new AnchorPane[1]; // Tableau pour permettre modification dans lambda
6307
6308 // Déterminer si c'est une création (nouveau HS) ou une édition (HS existant)
6310
6311 // Initialiser le navigateur avec le panorama sélectionné ou le panorama actuel
6312 if (!bEstCreation) {
6313 for (int ii1 = 0; ii1 < getiNombrePanoramiques(); ii1++) {
6315 String strNomXMLFile = strFichPano.substring(strFichPano.lastIndexOf(File.separator) + 1, strFichPano.length()).split("\\.")[0] + ".xml";
6316 if (strNomXMLFile.equals(getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getStrFichierXML())) {
6319 }
6320 }
6322 getPanoramiquesProjet()[iNumeroPanoChoisitHS].getImgVisuPanoramique(), 0, 0, 700, 438, true);
6323
6324 // Passer l'objet Panoramique pour utiliser le cache pré-calculé
6325 navigateurPano2Array[0].setImagePanoramique(
6326 getPanoramiquesProjet()[iNumeroPanoChoisitHS].getStrNomFichier(),
6327 getPanoramiquesProjet()[iNumeroPanoChoisitHS].getImgVisuPanoramique(),
6329 );
6330
6331 if (getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getRegardX() != -1000) {
6332 navigateurPano2Array[0].setChoixLongitude(getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getRegardX());
6333 } else {
6334 navigateurPano2Array[0].setChoixLongitude(0);
6335 }
6336 navigateurPano2Array[0].setLongitude(navigateurPano2Array[0].getChoixLongitude());
6337 if (getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getRegardY() != -1000) {
6338 navigateurPano2Array[0].setChoixLatitude(getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getRegardY());
6339 } else {
6340 navigateurPano2Array[0].setChoixLatitude(0);
6341 }
6342 navigateurPano2Array[0].setLatitude(navigateurPano2Array[0].getChoixLatitude());
6343 if (getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getChampVisuel() != 0) {
6344 navigateurPano2Array[0].setChoixFov(getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getChampVisuel());
6345 } else {
6346 navigateurPano2Array[0].setChoixFov(50);
6347 }
6348 navigateurPano2Array[0].setFov(navigateurPano2Array[0].getChoixFov());
6350
6351 // Masquer le bouton plein écran dans la popup
6352 if (navigateurPano2Array[0].getBtnPleinEcran() != null) {
6353 navigateurPano2Array[0].getBtnPleinEcran().setVisible(false);
6354 navigateurPano2Array[0].getBtnPleinEcran().setManaged(false);
6355 }
6356
6357 apVisuPanoHSArray[0].setDisable(false);
6358
6359 } else {
6360 // En mode création : afficher un message au lieu d'une image fixe
6361 navigateurPano2Array[0] = null;
6362 apVisuPanoHSArray[0] = new AnchorPane();
6363 apVisuPanoHSArray[0].setPrefSize(700, 438);
6364 apVisuPanoHSArray[0].setStyle("-fx-background-color: #f0f0f0; " +
6365 "-fx-border-color: #ccc; " +
6366 "-fx-border-width: 1; " +
6367 "-fx-background-radius: 5; " +
6368 "-fx-border-radius: 5;");
6369
6370 Label lblMessage = new Label("Veuillez choisir un panorama");
6371 lblMessage.setStyle("-fx-font-size: 18px; " +
6372 "-fx-text-fill: #999; " +
6373 "-fx-font-weight: bold;");
6374 lblMessage.setLayoutX(200);
6375 lblMessage.setLayoutY(210);
6376 apVisuPanoHSArray[0].getChildren().add(lblMessage);
6377
6378 apVisuPanoHSArray[0].setDisable(true);
6379 }
6380
6381 // Conteneur principal avec design moderne
6383 aplistePano.setOpacity(1);
6384
6385 // Fond avec coins arrondis et ombre
6386 Pane paneFond = new Pane();
6387 paneFond.setOnMouseClicked((mouseEvent) -> {
6388 mouseEvent.consume();
6389 });
6390 paneFond.setStyle("-fx-background-color: linear-gradient(to bottom, #e8e8e8, #d0d0d0); " +
6391 "-fx-background-radius: 10; " +
6392 "-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.3), 10, 0, 0, 5);");
6393 paneFond.setPrefWidth(800);
6394 paneFond.setPrefHeight(778); // Hauteur ajustée: titre(40) + scroll(200) + visu(438) + label(20) + boutons(80)
6395 paneFond.setMinWidth(800);
6396 paneFond.setMinHeight(778);
6397 aplistePano.getChildren().add(paneFond);
6398
6399 // Titre
6400 Label lblTitre = new Label("Sélectionnez le panorama de destination");
6401 lblTitre.setStyle("-fx-font-size: 16px; -fx-font-weight: bold; -fx-text-fill: #333;");
6402 lblTitre.setLayoutX(20);
6403 lblTitre.setLayoutY(15);
6404 paneFond.getChildren().add(lblTitre);
6405
6406 // Label pour afficher le nom du panorama sélectionné (déclaré ici pour être accessible partout)
6407 final Label lblPanoSelectionne = new Label("");
6408 lblPanoSelectionne.setStyle("-fx-font-size: 12px; -fx-text-fill: #666;");
6409 lblPanoSelectionne.setLayoutX(50);
6410 lblPanoSelectionne.setLayoutY(703);
6411 lblPanoSelectionne.setPrefWidth(760);
6412 paneFond.getChildren().add(lblPanoSelectionne);
6413
6414 // Pane pour contenir les vignettes dans un FlowPane
6416 flowVignettes.setHgap(10);
6417 flowVignettes.setVgap(10);
6418 flowVignettes.setPadding(new Insets(10));
6419 flowVignettes.setPrefWrapLength(760); // Plus large pour 5 colonnes
6420
6421 // ScrollPane pour les vignettes (hauteur adaptative: 150px = ~2 lignes suffisantes)
6423 scrollVignettes.setLayoutX(20);
6424 scrollVignettes.setLayoutY(50);
6425 scrollVignettes.setPrefWidth(760);
6426 scrollVignettes.setPrefHeight(150); // Réduit de 260 à 150px
6427 scrollVignettes.setStyle("-fx-background: #f5f5f5; " +
6428 "-fx-background-color: #f5f5f5; " +
6429 "-fx-border-color: #ccc; " +
6430 "-fx-border-width: 1; " +
6431 "-fx-border-radius: 5;");
6432 scrollVignettes.setFitToWidth(true);
6433 scrollVignettes.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
6434 scrollVignettes.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
6435 paneFond.getChildren().add(scrollVignettes);
6436
6437 // Déclarer le bouton Valider pour pouvoir l'utiliser dans les handlers
6438 final Button btnValide = new Button("✓ Valider");
6439 btnValide.setPrefWidth(120);
6440 btnValide.setPrefHeight(35);
6441 btnValide.setDisable(iNumeroPanoChoisitHS == -1); // Désactivé si aucune sélection
6442
6443 // Créer les vignettes avec bordure de sélection (exclure le panorama actuel)
6446
6447 for (int i = 0; i < getiNombrePanoramiques(); i++) {
6448 // Exclure le panorama actuel (on ne peut pas créer de HS vers soi-même)
6449 if (i == getiPanoActuel()) {
6450 continue;
6451 }
6452
6453 int iNumeroPano1 = i;
6455 String strNomCourt = strNomPano.substring(strNomPano.lastIndexOf(File.separator) + 1, strNomPano.lastIndexOf("."));
6456
6457 // Container avec bordure pour chaque vignette
6459 vignettesContainer[i].setPrefSize(150, 85);
6460 vignettesContainer[i].setStyle("-fx-background-color: white; " +
6461 "-fx-border-color: transparent; " +
6462 "-fx-border-width: 3; " +
6463 "-fx-border-radius: 5; " +
6464 "-fx-background-radius: 5; " +
6465 "-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 5, 0, 0, 2);");
6466
6467 ivPano[i] = new ImageView(getPanoramiquesProjet()[i].getImgVignettePanoramique());
6468 ivPano[i].setFitWidth(144);
6469 ivPano[i].setFitHeight(79);
6470 ivPano[i].setPreserveRatio(true);
6471 ivPano[i].setSmooth(true);
6472 ivPano[i].setCursor(Cursor.HAND);
6473 ivPano[i].setStyle("-fx-effect: null;");
6474
6475 vignettesContainer[i].getChildren().add(ivPano[i]);
6476
6478 tltpPano.setStyle(getStrTooltipStyle());
6480
6481 // Marquer la vignette sélectionnée initialement
6482 if (i == iNumeroPanoChoisitHS) {
6483 vignettesContainer[i].setStyle("-fx-background-color: white; " +
6484 "-fx-border-color: #4CAF50; " +
6485 "-fx-border-width: 3; " +
6486 "-fx-border-radius: 5; " +
6487 "-fx-background-radius: 5; " +
6488 "-fx-effect: dropshadow(gaussian, #4CAF50, 8, 0.6, 0, 0);");
6489 lblPanoSelectionne.setText("📍 " + strNomCourt);
6490 lblPanoSelectionne.setStyle("-fx-font-size: 13px; -fx-text-fill: #4CAF50; -fx-font-weight: bold; -fx-padding: 5 10;");
6491 }
6492
6493 vignettesContainer[i].setOnMouseClicked((mouseEvent) -> {
6496 String nomCourt = strNomPanoChoisitHS.substring(strNomPanoChoisitHS.lastIndexOf(File.separator) + 1, strNomPanoChoisitHS.lastIndexOf("."));
6497
6498 // Mettre à jour le visualiseur avec le cache pré-calculé
6500
6501 // Si c'est une création, on doit créer le navigateur et remplacer le message
6502 if (bEstCreation && navigateurPano2Array[0] == null) {
6503 // Retirer le message
6504 paneFond.getChildren().remove(apVisuPanoHSArray[0]);
6505
6506 // Créer le navigateur et le stocker dans le tableau
6508 panoSelectionne.getImgVisuPanoramique(), 0, 0, 700, 438, true);
6509
6510 // Passer l'objet Panoramique pour utiliser le cache pré-calculé
6511 navigateurPano2Array[0].setImagePanoramique(
6512 panoSelectionne.getStrNomFichier(),
6513 panoSelectionne.getImgVisuPanoramique(),
6515 );
6516
6517 navigateurPano2Array[0].setLongitude(panoSelectionne.getRegardX() - 180);
6518 navigateurPano2Array[0].setLatitude(panoSelectionne.getRegardY());
6519 navigateurPano2Array[0].setFov(panoSelectionne.getChampVisuel());
6520
6522
6523 // Masquer le bouton plein écran
6524 if (navigateurPano2Array[0].getBtnPleinEcran() != null) {
6525 navigateurPano2Array[0].getBtnPleinEcran().setVisible(false);
6526 navigateurPano2Array[0].getBtnPleinEcran().setManaged(false);
6527 }
6528
6529 apVisuPanoHSArray[0].setLayoutX(50);
6530 apVisuPanoHSArray[0].setLayoutY(215);
6531 apVisuPanoHSArray[0].setDisable(false);
6532 paneFond.getChildren().add(apVisuPanoHSArray[0]);
6533 } else if (navigateurPano2Array[0] != null) {
6534 // Mode édition : mettre à jour le navigateur existant
6535 navigateurPano2Array[0].setImagePanoramique(
6536 panoSelectionne.getStrNomFichier(),
6537 panoSelectionne.getImgVisuPanoramique(),
6539 );
6540 navigateurPano2Array[0].setLongitude(panoSelectionne.getRegardX() - 180);
6541 navigateurPano2Array[0].setLatitude(panoSelectionne.getRegardY());
6542 navigateurPano2Array[0].setFov(panoSelectionne.getChampVisuel());
6543 navigateurPano2Array[0].affiche();
6544 apVisuPanoHSArray[0].setDisable(false);
6545 }
6546
6547 // Mettre à jour les bordures de toutes les vignettes
6548 for (int j = 0; j < getiNombrePanoramiques(); j++) {
6549 if (vignettesContainer[j] == null) continue; // Ignorer le panorama actuel
6550
6551 if (j == iNumeroPano1) {
6552 vignettesContainer[j].setStyle("-fx-background-color: white; " +
6553 "-fx-border-color: #4CAF50; " +
6554 "-fx-border-width: 3; " +
6555 "-fx-border-radius: 5; " +
6556 "-fx-background-radius: 5; " +
6557 "-fx-effect: dropshadow(gaussian, #4CAF50, 8, 0.6, 0, 0);");
6558 } else {
6559 vignettesContainer[j].setStyle("-fx-background-color: white; " +
6560 "-fx-border-color: transparent; " +
6561 "-fx-border-width: 3; " +
6562 "-fx-border-radius: 5; " +
6563 "-fx-background-radius: 5; " +
6564 "-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 5, 0, 0, 2);");
6565 }
6566 }
6567
6568 // Mettre à jour le label
6569 lblPanoSelectionne.setText("📍 " + nomCourt);
6570 lblPanoSelectionne.setStyle("-fx-font-size: 13px; -fx-text-fill: #4CAF50; -fx-font-weight: bold; -fx-padding: 5 10;");
6571
6572 // Activer le bouton Valider
6573 btnValide.setDisable(false);
6574 });
6575
6576 // Effet hover
6577 vignettesContainer[i].setOnMouseEntered((e) -> {
6579 vignettesContainer[iNumeroPano1].setStyle("-fx-background-color: white; " +
6580 "-fx-border-color: #2196F3; " +
6581 "-fx-border-width: 3; " +
6582 "-fx-border-radius: 5; " +
6583 "-fx-background-radius: 5; " +
6584 "-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.3), 7, 0, 0, 3);");
6585 }
6586 });
6587
6588 vignettesContainer[i].setOnMouseExited((e) -> {
6590 vignettesContainer[iNumeroPano1].setStyle("-fx-background-color: white; " +
6591 "-fx-border-color: transparent; " +
6592 "-fx-border-width: 3; " +
6593 "-fx-border-radius: 5; " +
6594 "-fx-background-radius: 5; " +
6595 "-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 5, 0, 0, 2);");
6596 }
6597 });
6598
6599 flowVignettes.getChildren().add(vignettesContainer[i]);
6600 }
6601
6602 // Visualiseur 3D élargi (700x320), repositionné pour ne pas dépasser
6603 // Retirer apVisuPanoHS de son parent s'il en a déjà un
6604 if (apVisuPanoHSArray[0].getParent() != null) {
6606 }
6607 apVisuPanoHSArray[0].setLayoutX(50); // Centré: (800 - 700) / 2 = 50
6608 apVisuPanoHSArray[0].setLayoutY(215); // Juste après le ScrollPane
6609 paneFond.getChildren().add(apVisuPanoHSArray[0]);
6610
6611 // Positionner et styler le bouton Valider (déjà déclaré plus haut)
6612 btnValide.setLayoutX(550);
6613 btnValide.setLayoutY(733); // Après label: 703 + 30 = 733
6614 btnValide.setStyle("-fx-background-color: #4CAF50; " +
6615 "-fx-text-fill: white; " +
6616 "-fx-font-size: 14px; " +
6617 "-fx-font-weight: bold; " +
6618 "-fx-background-radius: 5; " +
6619 "-fx-cursor: hand;");
6620 btnValide.setOnMouseEntered(e -> btnValide.setStyle("-fx-background-color: #45a049; " +
6621 "-fx-text-fill: white; " +
6622 "-fx-font-size: 14px; " +
6623 "-fx-font-weight: bold; " +
6624 "-fx-background-radius: 5; " +
6625 "-fx-cursor: hand;"));
6626 btnValide.setOnMouseExited(e -> btnValide.setStyle("-fx-background-color: #4CAF50; " +
6627 "-fx-text-fill: white; " +
6628 "-fx-font-size: 14px; " +
6629 "-fx-font-weight: bold; " +
6630 "-fx-background-radius: 5; " +
6631 "-fx-cursor: hand;"));
6632 paneFond.getChildren().add(btnValide);
6633 btnValide.setOnMouseClicked((mouseEvent) -> {
6634 if (iNumeroPanoChoisitHS != -1) {
6635 panePanoramique.setCursor(Cursor.CROSSHAIR);
6636 panePanoramique.setOnMouseClicked(
6637 (me1) -> {
6639 }
6640 );
6642 if (getPanoramiquesProjet()[iNumeroPanoChoisitHS].getStrTitrePanoramique() != null) {
6644 TextField tfTxtHS = (TextField) vbOutils.lookup("#txtHS" + iNumHS);
6645 tfTxtHS.setText(strTexteHS);
6646 }
6647 double latitude = Math.round(navigateurPano2Array[0].getChoixLatitude() * 10) / 10.d;
6648 double longitude = Math.round(navigateurPano2Array[0].getChoixLongitude() * 10) / 10.d - 180;
6649 double fov = Math.round(navigateurPano2Array[0].getChoixFov() * 10) / 10.d;
6650 longitude = longitude % 360;
6651 longitude = longitude < 0 ? longitude + 360 : longitude;
6652 longitude = longitude > 180 ? longitude - 360 : longitude;
6658 @SuppressWarnings("rawtypes")
6659 ComboBox cbPanos = (ComboBox) vbOutils.lookup("#cbpano" + iNumHS);
6660 cbPanos.getSelectionModel().select(iNumeroPanoChoisitHS);
6661 aplistePano.setVisible(false);
6662 }
6663 mouseEvent.consume();
6664 });
6665
6666 // Bouton Annuler
6667 Button btnAnnuler = new Button("✗ Annuler");
6668 btnAnnuler.setPrefWidth(120);
6669 btnAnnuler.setPrefHeight(35);
6670 btnAnnuler.setLayoutX(660); // Décalé à gauche (était 680)
6671 btnAnnuler.setLayoutY(733); // Aligné avec btnValide
6672 btnAnnuler.setStyle("-fx-background-color: #f44336; " +
6673 "-fx-text-fill: white; " +
6674 "-fx-font-size: 14px; " +
6675 "-fx-font-weight: bold; " +
6676 "-fx-background-radius: 5; " +
6677 "-fx-cursor: hand;");
6678 btnAnnuler.setOnMouseEntered(e -> btnAnnuler.setStyle("-fx-background-color: #da190b; " +
6679 "-fx-text-fill: white; " +
6680 "-fx-font-size: 14px; " +
6681 "-fx-font-weight: bold; " +
6682 "-fx-background-radius: 5; " +
6683 "-fx-cursor: hand;"));
6684 btnAnnuler.setOnMouseExited(e -> btnAnnuler.setStyle("-fx-background-color: #f44336; " +
6685 "-fx-text-fill: white; " +
6686 "-fx-font-size: 14px; " +
6687 "-fx-font-weight: bold; " +
6688 "-fx-background-radius: 5; " +
6689 "-fx-cursor: hand;"));
6690 btnAnnuler.setOnMouseClicked((mouseEvent) -> {
6691 if (bEstCreation) {
6692 // Si c'est une création, supprimer le hotspot et le point
6693 Node nodePoint = (Node) panePanoramique.lookup("#point" + iNumHS);
6694 if (nodePoint != null) {
6695 panePanoramique.getChildren().remove(nodePoint);
6696 }
6697
6698 // Réindexer les IDs des circles suivants
6699 for (int io = iNumHS + 1; io < getiNumPoints(); io++) {
6700 nodePoint = (Node) panePanoramique.lookup("#point" + Integer.toString(io));
6701 if (nodePoint != null) {
6702 nodePoint.setId("point" + Integer.toString(io - 1));
6703 }
6704 }
6705
6706 // Supprimer le hotspot en cours de création
6711 }
6712 // Si c'est une édition, on ferme juste la fenêtre sans rien supprimer
6713 aplistePano.setVisible(false);
6714 mouseEvent.consume();
6715 });
6716 paneFond.getChildren().add(btnAnnuler);
6717
6718 // Bouton de fermeture (X)
6719 Button btnClose = new Button("×");
6720 btnClose.setPrefSize(30, 30);
6721 btnClose.setLayoutX(765);
6722 btnClose.setLayoutY(5);
6723 btnClose.setStyle("-fx-background-color: transparent; " +
6724 "-fx-text-fill: #999; " +
6725 "-fx-font-size: 24px; " +
6726 "-fx-font-weight: bold; " +
6727 "-fx-cursor: hand;");
6728 btnClose.setOnMouseEntered(e -> btnClose.setStyle("-fx-background-color: #f44336; " +
6729 "-fx-text-fill: white; " +
6730 "-fx-font-size: 24px; " +
6731 "-fx-font-weight: bold; " +
6732 "-fx-background-radius: 15; " +
6733 "-fx-cursor: hand;"));
6734 btnClose.setOnMouseExited(e -> btnClose.setStyle("-fx-background-color: transparent; " +
6735 "-fx-text-fill: #999; " +
6736 "-fx-font-size: 24px; " +
6737 "-fx-font-weight: bold; " +
6738 "-fx-cursor: hand;"));
6739 btnClose.setOnMouseClicked((mouseEvent) -> {
6740 if (bEstCreation) {
6741 // Si c'est une création, supprimer le hotspot et le point
6742 Node nodePoint = (Node) panePanoramique.lookup("#point" + iNumHS);
6743 if (nodePoint != null) {
6744 panePanoramique.getChildren().remove(nodePoint);
6745 }
6746
6747 // Réindexer les IDs des circles suivants
6748 for (int io = iNumHS + 1; io < getiNumPoints(); io++) {
6749 nodePoint = (Node) panePanoramique.lookup("#point" + Integer.toString(io));
6750 if (nodePoint != null) {
6751 nodePoint.setId("point" + Integer.toString(io - 1));
6752 }
6753 }
6754
6755 // Supprimer le hotspot en cours de création
6760 }
6761 // Si c'est une édition, on ferme juste la fenêtre sans rien supprimer
6762 aplistePano.setVisible(false);
6763 mouseEvent.consume();
6764 });
6765 paneFond.getChildren().add(btnClose);
6766
6767 aplistePano.setPrefWidth(800);
6768 aplistePano.setPrefHeight(778); // Ajusté à la hauteur du paneFond
6769 aplistePano.setMinWidth(800);
6770 aplistePano.setMinHeight(778);
6771
6772 setbDejaSauve(false);
6773 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
6774
6775 return aplistePano;
6776 }
6777
6781 private static void valideHS() {
6782
6783 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspots(); i++) {
6784 @SuppressWarnings("rawtypes")
6785 ComboBox cbPanos = (ComboBox) vbOutils.lookup("#cbpano" + i);
6786 TextField tfTexteHS = (TextField) vbOutils.lookup("#txtHS" + i);
6787 if (tfTexteHS != null) {
6789 }
6790 if (cbPanos != null) {
6793 cbPanos.getSelectionModel().getSelectedIndex()
6794 );
6795 }
6796 @SuppressWarnings("unchecked")
6798 if (cbTypeAnimation != null && cbTypeAnimation.getValue() != null) {
6800 }
6801 CheckBox cbAgrandit = (CheckBox) vbOutils.lookup("#agranditSurvol" + i);
6802 if (cbAgrandit != null) {
6804 }
6805 ColorPicker cpCouleurPerso = (ColorPicker) vbOutils.lookup("#couleurPerso" + i);
6806 if (cpCouleurPerso != null && cpCouleurPerso.getValue() != null) {
6807 Color couleur = cpCouleurPerso.getValue();
6808 String strCouleur = couleur.getHue() + ";" + couleur.getSaturation() + ";" + couleur.getBrightness();
6810 }
6811 }
6812 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotImage(); i++) {
6813 TextField tfTexteHS = (TextField) vbOutils.lookup("#txtHSImage" + i);
6814 if (tfTexteHS != null) {
6816 }
6817 @SuppressWarnings("unchecked")
6818 ComboBox<String> cbTypeAnimation = (ComboBox<String>) vbOutils.lookup("#animeImage" + i);
6819 if (cbTypeAnimation != null && cbTypeAnimation.getValue() != null) {
6821 }
6822 CheckBox cbAgrandit = (CheckBox) vbOutils.lookup("#agranditSurvolImage" + i);
6823 if (cbAgrandit != null) {
6825 }
6826 ColorPicker cpCouleurPersoImage = (ColorPicker) vbOutils.lookup("#couleurPersoImage" + i);
6827 if (cpCouleurPersoImage != null && cpCouleurPersoImage.getValue() != null) {
6828 Color couleur = cpCouleurPersoImage.getValue();
6829 String strCouleur = couleur.getHue() + ";" + couleur.getSaturation() + ";" + couleur.getBrightness();
6831 }
6832 }
6833 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotHTML(); i++) {
6834 TextField tfTexteHS = (TextField) vbOutils.lookup("#txtHSHTML" + i);
6835 if (tfTexteHS != null) {
6837 }
6838 @SuppressWarnings("unchecked")
6839 ComboBox<String> cbTypeAnimation = (ComboBox<String>) vbOutils.lookup("#animeHTML" + i);
6840 if (cbTypeAnimation != null && cbTypeAnimation.getValue() != null) {
6842 }
6843 CheckBox cbAgrandit = (CheckBox) vbOutils.lookup("#agranditSurvolHTML" + i);
6844 if (cbAgrandit != null) {
6846 }
6847 ColorPicker cpCouleurPersoHTML = (ColorPicker) vbOutils.lookup("#couleurPersoHTML" + i);
6848 if (cpCouleurPersoHTML != null && cpCouleurPersoHTML.getValue() != null) {
6849 Color couleur = cpCouleurPersoHTML.getValue();
6850 String strCouleur = couleur.getHue() + ";" + couleur.getSaturation() + ";" + couleur.getBrightness();
6852 }
6853 }
6854 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getiNombreHotspotDiapo(); i++) {
6855 TextField tfTexteHS = (TextField) vbOutils.lookup("#txtDIA" + i);
6856 if (tfTexteHS != null) {
6858 }
6859 CheckBox cbAnime = (CheckBox) vbOutils.lookup("#animeDIA" + i);
6860 if (cbAnime != null) {
6862 }
6863 }
6864
6865 }
6866
6875 private static WritableImage transformerCouleurHotspot(Image imageSource, double couleurFinale, double sat, double bright) {
6876 if (imageSource == null) {
6877 System.err.println("⚠️ transformerCouleurHotspot: imageSource est null");
6878 return null;
6879 }
6880
6881 int width = (int) imageSource.getWidth();
6882 int height = (int) imageSource.getHeight();
6883
6884 // Vérifier que les dimensions sont valides
6885 if (width <= 0 || height <= 0) {
6886 System.err.println("⚠️ transformerCouleurHotspot: dimensions invalides (width=" + width + ", height=" + height + ")");
6887 return null;
6888 }
6889
6891 PixelReader pr = imageSource.getPixelReader();
6892 PixelWriter pw = imageTransformee.getPixelWriter();
6893
6894 for (int y = 0; y < height; y++) {
6895 for (int x = 0; x < width; x++) {
6896 Color color = pr.getColor(x, y);
6897 double brightness = color.getBrightness();
6898 double saturation = color.getSaturation();
6899 double opacity = color.getOpacity();
6900 Color couleur;
6901
6902 if ((sat < 0.02) && (saturation > 0.05)) {
6903 double bright1;
6904 if (brightness > 0.1 && brightness < 0.9) {
6905 bright1 = brightness * 0.5 + bright * 0.5;
6906 } else {
6908 }
6910 } else {
6911 double sat1;
6912 double bright1;
6913 if (saturation < 0.3 || (brightness < 0.2 || brightness > 0.8)) {
6914 sat1 = saturation;
6916 } else {
6917 sat1 = saturation * (1 - saturation + sat);
6918 double exp = Math.exp(-4 * Math.pow(2 * brightness - 1, 2));
6919 bright1 = bright * exp + brightness * (1 - exp);
6920 }
6922 }
6923 pw.setColor(x, y, couleur);
6924 }
6925 }
6926
6927 return imageTransformee;
6928 }
6929
6938 @SuppressWarnings("unused")
6940 if (image == null) {
6941 return null;
6942 }
6943
6944 // Convertir Image en WritableImage si nécessaire
6948 } else {
6949 int width = (int) image.getWidth();
6950 int height = (int) image.getHeight();
6952 PixelReader pixelReader = image.getPixelReader();
6953 PixelWriter pixelWriter = writableImage.getPixelWriter();
6954 for (int y = 0; y < height; y++) {
6955 for (int x = 0; x < width; x++) {
6956 pixelWriter.setArgb(x, y, pixelReader.getArgb(x, y));
6957 }
6958 }
6959 }
6960
6962 }
6963
6973 if (imageColoree == null) {
6974 return null;
6975 }
6976
6977 try {
6978 // Créer le répertoire temp/panovisu/images/hotspots s'il n'existe pas
6979 File repertoireHotspots = new File(getStrRepertTemp() + File.separator + "panovisu" + File.separator + "images" + File.separator + "hotspots");
6980 if (!repertoireHotspots.exists()) {
6981 repertoireHotspots.mkdirs();
6982 }
6983
6984 // Générer un nom de fichier unique
6985 String nomFichier = prefixe + "_pano" + numPano + "_" + index + "_" + System.currentTimeMillis() + ".png";
6987
6988 // Sauvegarder l'image
6990
6991 return nomFichier;
6992 } catch (IOException ex) {
6993 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
6994 return null;
6995 }
6996 }
6997
7007 try {
7008 String couleurPerso = null;
7009 String nomIconeSource = null;
7010
7011 // Récupérer la couleur personnalisée et le nom d'icône source selon le type de hotspot
7013 couleurPerso = ((HotSpot) hotspot).getStrCouleurPerso();
7014 nomIconeSource = ((HotSpot) hotspot).getStrNomIconeSource();
7015 } else if (hotspot instanceof HotspotImage) {
7016 couleurPerso = ((HotspotImage) hotspot).getStrCouleurPerso();
7017 nomIconeSource = ((HotspotImage) hotspot).getStrNomIconeSource();
7018 } else if (hotspot instanceof HotspotHTML) {
7019 couleurPerso = ((HotspotHTML) hotspot).getStrCouleurPerso();
7020 nomIconeSource = ((HotspotHTML) hotspot).getStrNomIconeSource();
7021 }
7022
7023 // DEBUG
7024 System.out.println("🔍 DEBUG reconstruireIconeHotspot:");
7025 System.out.println(" - prefixe: " + prefixe);
7026 System.out.println(" - nomFichierIconeDefaut: " + nomFichierIconeDefaut);
7027 System.out.println(" - nomIconeSource: " + nomIconeSource);
7028 System.out.println(" - couleurPerso: " + couleurPerso);
7029
7030 // Déterminer quelle icône utiliser
7032 System.out.println(" - nomFichierIcone utilisé: " + nomFichierIcone);
7033
7034 // Charger l'icône source
7035 File fileIcone = new File(getStrRepertAppli() + File.separator + "theme" + File.separator + "hotspots" + File.separator + nomFichierIcone);
7036 if (!fileIcone.exists()) {
7037 System.err.println("⚠️ Fichier icône introuvable: " + fileIcone.getAbsolutePath());
7038 return;
7039 }
7040
7041 Image imgOriginal = new Image("file:" + fileIcone.getAbsolutePath());
7042
7043 // Stocker l'image source dans l'objet hotspot
7045 ((HotSpot) hotspot).setImgIconeSource(imgOriginal);
7046 } else if (hotspot instanceof HotspotImage) {
7047 ((HotspotImage) hotspot).setImgIconeSource(imgOriginal);
7048 } else if (hotspot instanceof HotspotHTML) {
7049 ((HotspotHTML) hotspot).setImgIconeSource(imgOriginal);
7050 }
7051
7052 // Déterminer les valeurs HSB à utiliser
7053 double hue, saturation, brightness;
7054
7055 if (couleurPerso != null && !couleurPerso.isEmpty()) {
7056 // Cas 2 et 3: Utiliser la couleur personnalisée
7057 String[] couleurParts = couleurPerso.split(";");
7058 if (couleurParts.length != 3) {
7059 return;
7060 }
7061 hue = Double.parseDouble(couleurParts[0]);
7062 saturation = Double.parseDouble(couleurParts[1]);
7063 brightness = Double.parseDouble(couleurParts[2]);
7064 } else {
7065 // Cas 1: Icône personnalisée sans couleur personnalisée
7066 // Utiliser la couleur générique du type de hotspot
7070 } else if (hotspot instanceof HotspotImage) {
7072 } else if (hotspot instanceof HotspotHTML) {
7074 } else {
7075 return;
7076 }
7077
7078 hue = couleurGenerique.getHue();
7079 saturation = couleurGenerique.getSaturation();
7080 brightness = couleurGenerique.getBrightness();
7081 }
7082
7083 // Appliquer la transformation de couleur sur l'icône
7085
7086 // Sauvegarder l'icône transformée
7088
7089 // Stocker le nom du fichier dans le hotspot
7090 if (nomFichier != null) {
7092 ((HotSpot) hotspot).setStrFichierImage(nomFichier);
7093 } else if (hotspot instanceof HotspotImage) {
7094 ((HotspotImage) hotspot).setStrFichierImage(nomFichier);
7095 } else if (hotspot instanceof HotspotHTML) {
7096 ((HotspotHTML) hotspot).setStrFichierImage(nomFichier);
7097 }
7098 }
7099 } catch (Exception ex) {
7100 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
7101 }
7102 }
7103
7110 @SuppressWarnings({ "unchecked", "unused" })
7111 public static Pane paneAffichageHS(String strLstPano, int iNumPano) {
7112
7113 Pane paneHotSpots = new Pane();
7114 paneHotSpots.setTranslateY(10);
7115 paneHotSpots.setTranslateX(10);
7116 VBox vbHotspots = new VBox(5);
7117 paneHotSpots.getChildren().add(vbHotspots);
7119 int io;
7120 for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspots(); io++) {
7121 Label lblSep = new Label(" ");
7122 Label lblSep1 = new Label(" ");
7123 VBox vbPanneauHS = new VBox();
7124 double deplacement = 0;
7125 vbPanneauHS.setLayoutX(deplacement);
7127 // Hauteur de base (sans personnalisation dépliée) - augmentée de 270 à 390, puis 400
7128 double hauteurInitiale = 400;
7129 paneHsPanoramique.setPrefHeight(hauteurInitiale);
7130 paneHsPanoramique.setMinHeight(hauteurInitiale);
7131 paneHsPanoramique.setMaxHeight(hauteurInitiale);
7132
7133 int iNum1 = io;
7134 Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (@SuppressWarnings("unused") ActionEvent event) -> {
7135 Circle c1 = (Circle) panePanoramique.lookup("#point" + iNum1);
7136 if (c1 != null) {
7137 if (c1.getFill() == Color.RED) {
7138 c1.setFill(Color.YELLOW);
7139 c1.setStroke(Color.RED);
7140 } else {
7141 c1.setFill(Color.RED);
7142 c1.setStroke(Color.YELLOW);
7143 }
7144 }
7145 }));
7146 timBouge.setCycleCount(Timeline.INDEFINITE);
7147 timBouge.pause();
7148 paneHsPanoramique.setOnMouseEntered((e) -> {
7149 timBouge.play();
7150 });
7151 paneHsPanoramique.setOnMouseExited((e) -> {
7152 timBouge.pause();
7153 Circle c1 = (Circle) panePanoramique.lookup("#point" + iNum1);
7154 if (c1 != null) {
7155 c1.setFill(Color.YELLOW);
7156 c1.setStroke(Color.RED);
7157 }
7158 });
7159 paneHsPanoramique.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;");
7160 paneHsPanoramique.setId("HS" + io);
7161 lblPoint = new Label("Point #" + (io + 1));
7162 lblPoint.setPadding(new Insets(5, 10, 5, 5));
7163 lblPoint.setTranslateX(-deplacement);
7164 lblPoint.getStyleClass().add("titreOutil");
7165 Separator sepHotspots = new Separator(Orientation.HORIZONTAL);
7166 sepHotspots.setTranslateX(-deplacement);
7167 sepHotspots.setPrefWidth(351);
7168 sepHotspots.setTranslateX(2);
7169 paneHsPanoramique.setPrefWidth(355);
7170 vbPanneauHS.getChildren().addAll(lblPoint, sepHotspots);
7171 if (strLstPano != null) {
7172
7173 Label lblLien = new Label(rbLocalisation.getString("main.panoramiqueDestination"));
7174 lblLien.setTranslateX(10);
7175 @SuppressWarnings("rawtypes")
7177 String[] strListe = strLstPano.split(";");
7178 cbDestPano.getItems().addAll(Arrays.asList(strListe));
7180 cbDestPano.setTranslateX(10);
7181 cbDestPano.setId("cbpano" + io);
7182 cbDestPano.getSelectionModel().select(iNum11);
7183 cbDestPano.getSelectionModel().selectedIndexProperty().addListener((ov, t, t1) -> {
7184 valideHS();
7185 if (dejaCharge) {
7186 dejaCharge = false;
7188 Pane affHS1 = paneAffichageHS(strListePano(), iNumPano);
7189 affHS1.setId("labels");
7190 vbVisuHotspots.getChildren().add(affHS1);
7191 }
7192 });
7193 if (iNum11 != -1) {
7194 int iNumPan = iNum11;
7196 ivAfficheVignettePano.setPreserveRatio(true);
7197 ivAfficheVignettePano.setFitWidth(300);
7198 ivAfficheVignettePano.setLayoutY(10);
7199 ivAfficheVignettePano.setCursor(Cursor.HAND);
7200 ivAfficheVignettePano.setOnMouseClicked((e) -> {
7202 });
7204 apVisuVignettePano.setPrefHeight(170);
7205 apVisuVignettePano.setTranslateX(10);
7206 vbPanneauHS.getChildren().addAll(lblLien, cbDestPano, apVisuVignettePano, lblSep);
7207 } else {
7208 vbPanneauHS.getChildren().addAll(lblLien, cbDestPano, lblSep);
7209 }
7210
7211 }
7212 // === APERÇU ICÔNE HOTSPOT (TOUJOURS VISIBLE) ===
7214 ivApercuIconeHS.setId("ivApercuHS" + io);
7215 ivApercuIconeHS.setFitWidth(48);
7216 ivApercuIconeHS.setFitHeight(48);
7217 ivApercuIconeHS.setPreserveRatio(true);
7218 ivApercuIconeHS.setTranslateX(260);
7219
7220 // Charger l'image actuelle du hotspot avec la couleur appliquée
7222 if (fichierImageApercuHS != null && !fichierImageApercuHS.isEmpty()) {
7223 try {
7224 File fileIconeHS = new File(getStrRepertTemp() + File.separator + "images" + File.separator + fichierImageApercuHS);
7225 if (fileIconeHS.exists()) {
7226 ivApercuIconeHS.setImage(new Image("file:" + fileIconeHS.getAbsolutePath()));
7227 }
7228 } catch (Exception ex) {
7229 // Ignorer et utiliser l'icône par défaut
7230 }
7231 }
7232
7233 // Si pas d'image personnalisée, utiliser l'icône source ou l'icône par défaut avec la couleur
7234 if (ivApercuIconeHS.getImage() == null) {
7235 try {
7236 // Déterminer quelle icône source utiliser
7238 String nomIconeAUtiliser = (nomIconeSource != null && !nomIconeSource.isEmpty()) ? nomIconeSource : strNomfichierHS;
7239
7240 // DEBUG
7241 System.out.println("🎨 DEBUG aperçu HS #" + io + ":");
7242 System.out.println(" - nomIconeSource: " + nomIconeSource);
7243 System.out.println(" - strNomfichierHS: " + strNomfichierHS);
7244 System.out.println(" - nomIconeAUtiliser: " + nomIconeAUtiliser);
7245
7246 File fileIconeDefaut = new File(getStrRepertAppli() + File.separator + "theme" + File.separator + "hotspots" + File.separator + nomIconeAUtiliser);
7247 if (fileIconeDefaut.exists() && !strTypeHS.equals("gif")) {
7248 Image imgDefaut = new Image("file:" + fileIconeDefaut.getAbsolutePath());
7249
7250 // Appliquer la couleur du hotspot
7253 if (couleurPersoHS != null && !couleurPersoHS.isEmpty()) {
7254 String[] couleurParts = couleurPersoHS.split(";");
7255 if (couleurParts.length == 3) {
7256 try {
7257 double hue = Double.parseDouble(couleurParts[0]);
7258 double saturation = Double.parseDouble(couleurParts[1]);
7259 double brightness = Double.parseDouble(couleurParts[2]);
7261 } catch (NumberFormatException e) {
7262 couleurHS = Color.YELLOW;
7263 }
7264 } else {
7265 couleurHS = Color.YELLOW;
7266 }
7267 } else {
7268 couleurHS = Color.YELLOW;
7269 }
7270
7272 imgDefaut,
7273 couleurHS.getHue(),
7274 couleurHS.getSaturation(),
7275 couleurHS.getBrightness()
7276 );
7277 ivApercuIconeHS.setImage(imgColoree);
7278 } else if (fileIconeDefaut.exists()) {
7279 // Pour les GIF, afficher sans transformation
7280 ivApercuIconeHS.setImage(new Image("file:" + fileIconeDefaut.getAbsolutePath()));
7281 }
7282 } catch (Exception ex) {
7283 // Ignorer
7284 }
7285 }
7286
7287 Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot"));
7288 lblTexteHS.setTranslateX(10);
7289 TextField tfTexteHS = new TextField();
7290 if (getPanoramiquesProjet()[iNumPano].getHotspot(io).getStrInfo() != null) {
7291 tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspot(io).getStrInfo());
7292 }
7293 tfTexteHS.textProperty().addListener((@SuppressWarnings("unused") final ObservableValue<? extends String> observable, @SuppressWarnings("unused") final String oldValue, @SuppressWarnings("unused") final String newValue) -> {
7294 valideHS();
7295 });
7296
7297 tfTexteHS.setId("txtHS" + io);
7298 tfTexteHS.setPrefSize(200, 25);
7299 tfTexteHS.setMaxSize(200, 20);
7300 tfTexteHS.setTranslateX(60);
7301
7302 vbPanneauHS.getChildren().addAll(ivApercuIconeHS, lblTexteHS, tfTexteHS);
7303
7304 // === SECTION PERSONNALISATION PLIABLE ===
7305 // Créer le VBox pour contenir tous les éléments de personnalisation
7306 final VBox vbPersonnalisation = new VBox(5);
7307 vbPersonnalisation.setTranslateX(5);
7308 vbPersonnalisation.setId("vbPerso" + io);
7309 vbPersonnalisation.setVisible(false); // Masqué par défaut
7310 vbPersonnalisation.setManaged(false); // Ne prend pas de place quand masqué
7311
7312 // Bouton pour plier/déplier la section avec le label
7313 HBox hboxTitrePerso = new HBox(5);
7314 hboxTitrePerso.setTranslateX(5);
7315 hboxTitrePerso.setStyle("-fx-cursor: hand; -fx-padding: 5px;");
7316 final Label lblBtnPerso = new Label("+");
7317 lblBtnPerso.setStyle("-fx-font-size: 14px; -fx-font-weight: bold;");
7318 lblBtnPerso.setMinWidth(20);
7319 Label lblTitrePerso = new Label(rbLocalisation.getString("main.personnalisation"));
7320 lblTitrePerso.setStyle("-fx-font-weight: bold;");
7321 hboxTitrePerso.getChildren().addAll(lblBtnPerso, lblTitrePerso);
7322
7323 // Hauteurs des panes (base + personnalisation)
7324 final double hauteurBase = 400; // Hauteur de base sans personnalisation (augmenté de 270 à 390, puis 400)
7325 final double hauteurPersonnalisation = 310; // Hauteur supplémentaire pour personnalisation
7326
7327 // Référence finale pour utilisation dans la lambda
7329
7330 // Action pour plier/déplier
7331 javafx.event.EventHandler<javafx.scene.input.MouseEvent> togglePerso = (javafx.scene.input.MouseEvent evt) -> {
7332 // IMPORTANT: Consommer l'événement pour éviter la double détection
7333 evt.consume();
7334
7335 javafx.application.Platform.runLater(() -> {
7336 boolean estVisible = vbPersonnalisation.isVisible();
7337
7338 // Toggle la visibilité
7339 vbPersonnalisation.setVisible(!estVisible);
7340 vbPersonnalisation.setManaged(!estVisible);
7341
7342 // Changer le texte du bouton
7343 lblBtnPerso.setText(estVisible ? "+" : "-");
7344
7345 // Adapter la hauteur du pane
7347 paneFinal.setPrefHeight(nouvelleHauteur);
7348 paneFinal.setMinHeight(nouvelleHauteur);
7349 paneFinal.setMaxHeight(nouvelleHauteur);
7350
7351 // Forcer le recalcul du layout sur tous les parents
7352 vbPanneauHS.requestLayout();
7353 paneFinal.requestLayout();
7354 if (paneFinal.getParent() != null) {
7355 paneFinal.getParent().requestLayout();
7356 }
7357 });
7358 };
7359
7360 // N'attacher le handler QUE sur le HBox pour éviter la double détection
7361 hboxTitrePerso.setOnMouseClicked(togglePerso);
7362
7363 // Separator
7364 Separator sepPerso = new Separator(Orientation.HORIZONTAL);
7365 sepPerso.setPrefWidth(300);
7366 sepPerso.setTranslateX(5);
7367
7368 // Label pour choisir l'image de l'icône
7369 Label lblImageIcone = new Label(rbLocalisation.getString("main.imageIcone"));
7370 lblImageIcone.setTranslateX(5);
7371
7372 // Button et ImageView pour l'image de l'icône
7373 Button btnChoisirIcone = new Button(rbLocalisation.getString("main.choisirImageIcone"));
7374 btnChoisirIcone.setId("btnIcone" + io);
7375 btnChoisirIcone.setTranslateX(5);
7376 btnChoisirIcone.setPrefWidth(200);
7377
7379 ivIconeActuelle.setId("ivIcone" + io);
7380 ivIconeActuelle.setFitWidth(32);
7381 ivIconeActuelle.setFitHeight(32);
7382 ivIconeActuelle.setPreserveRatio(true);
7383 ivIconeActuelle.setTranslateX(210);
7384
7385 // Charger l'image actuelle du hotspot si elle existe
7387 if (fichierImageHS != null && !fichierImageHS.isEmpty()) {
7388 try {
7389 File fileIconeHS = new File(getStrRepertTemp() + File.separator + "images" + File.separator + fichierImageHS);
7390 if (fileIconeHS.exists()) {
7391 ivIconeActuelle.setImage(new Image("file:" + fileIconeHS.getAbsolutePath()));
7392 }
7393 } catch (Exception ex) {
7394 // Ignorer
7395 }
7396 } else {
7397 // Afficher l'icône par défaut
7398 try {
7399 File fileIconeDefaut = new File(getStrRepertAppli() + File.separator + "theme" + File.separator + "hotspots" + File.separator + strNomfichierHS);
7400 if (fileIconeDefaut.exists()) {
7401 ivIconeActuelle.setImage(new Image("file:" + fileIconeDefaut.getAbsolutePath()));
7402 }
7403 } catch (Exception ex) {
7404 // Ignorer
7405 }
7406 }
7407
7408 HBox hboxImageIcone = new HBox(5);
7409 hboxImageIcone.setTranslateX(5);
7410 hboxImageIcone.getChildren().addAll(btnChoisirIcone, ivIconeActuelle);
7411
7412 // ComboBox pour le type d'animation (déplacé ici pour être avant le bouton)
7413 Label lblTypeAnimation = new Label(rbLocalisation.getString("main.typeAnimation"));
7414 lblTypeAnimation.setTranslateX(10);
7416 cbTypeAnimation.setId("anime" + io);
7417 cbTypeAnimation.setTranslateX(10);
7418 cbTypeAnimation.setPrefWidth(200);
7419 cbTypeAnimation.getItems().addAll(
7420 "none",
7421 "pulse",
7422 "rotation",
7423 "desaturation",
7424 "bounce",
7425 "swing",
7426 "glow",
7427 "heartbeat",
7428 "shake",
7429 "flip",
7430 "wobble",
7431 "tada",
7432 "flash",
7433 "rubber",
7434 "jello",
7435 "neon",
7436 "float"
7437 );
7438 cbTypeAnimation.setValue(getPanoramiquesProjet()[iNumPano].getHotspot(io).getStrTypeAnimation());
7439 cbTypeAnimation.valueProperty().addListener((obs, oldVal, newVal) -> {
7440 valideHS();
7441 });
7442
7443 // CheckBox pour Agrandissement au survol
7444 CheckBox cbAgrandit = new CheckBox(rbLocalisation.getString("main.agrandissementSurvol"));
7445 cbAgrandit.setId("agranditSurvol" + io);
7446 cbAgrandit.setTranslateX(10);
7447 cbAgrandit.setSelected(getPanoramiquesProjet()[iNumPano].getHotspot(io).isAgranditSurvol());
7448 cbAgrandit.selectedProperty().addListener((obs, oldVal, newVal) -> {
7449 valideHS();
7450 });
7451
7452 // Label et ColorPicker pour couleur personnalisée (déplacé ici)
7453 Label lblCouleurPerso = new Label(rbLocalisation.getString("main.couleurPersonnalisee"));
7454 lblCouleurPerso.setPrefHeight(29);
7455 lblCouleurPerso.setMaxHeight(29);
7456 lblCouleurPerso.setPrefWidth(200);
7457 lblCouleurPerso.setTranslateX(10);
7458
7460 cpCouleurPerso.setId("couleurPerso" + io);
7461 cpCouleurPerso.setTranslateX(10);
7462 cpCouleurPerso.setPrefWidth(160);
7463
7464 // ImageView pour l'aperçu du hotspot avec la couleur
7466 ivApercuCouleur.setId("apercuCouleur" + io);
7467 ivApercuCouleur.setFitWidth(32);
7468 ivApercuCouleur.setFitHeight(32);
7469 ivApercuCouleur.setPreserveRatio(true);
7470 ivApercuCouleur.setTranslateX(180);
7471
7472 // Charger l'image du hotspot panoramique
7473 String strNomHotspot = strNomfichierHS;
7474 String strTypeHotspot = strTypeHS;
7475
7476 // IMPORTANT: Charger l'image source spécifique à ce hotspot
7479
7480 System.out.println("=== DEBUG Hotspot #" + io + " ===");
7481 System.out.println("Fichier image personnalisée: " + fichierImagePerso);
7482 System.out.println("Icône par défaut: " + strNomHotspot);
7483
7484 // Vérifier d'abord si le hotspot a déjà une image source stockée
7486 if (imgSourceStockee != null) {
7488 System.out.println("Image source récupérée depuis le hotspot (stockée en mémoire)");
7489 }
7490 // Sinon, essayer de charger l'image personnalisée
7491 else if (fichierImagePerso != null && !fichierImagePerso.isEmpty()) {
7492 try {
7493 File filePerso = new File(getStrRepertTemp() + File.separator + "images" + File.separator + fichierImagePerso);
7494 if (filePerso.exists()) {
7495 Image imgTemp = new Image("file:" + filePerso.getAbsolutePath());
7496 // Vérifier que l'image est valide
7497 if (!imgTemp.isError() && imgTemp.getWidth() > 0 && imgTemp.getHeight() > 0) {
7499 System.out.println("Image personnalisée chargée: " + filePerso.getAbsolutePath() + " (" + imgTemp.getWidth() + "x" + imgTemp.getHeight() + ")");
7500 // Stocker l'image source dans le hotspot pour utilisation future
7502 } else {
7503 System.err.println("⚠️ Image personnalisée invalide: " + filePerso.getAbsolutePath() + " (error=" + imgTemp.isError() + ", w=" + imgTemp.getWidth() + ", h=" + imgTemp.getHeight() + ")");
7504 }
7505 } else {
7506 System.out.println("Fichier personnalisé introuvable: " + filePerso.getAbsolutePath());
7507 }
7508 } catch (Exception e) {
7509 System.err.println("Erreur chargement image personnalisée: " + e.getMessage());
7510 }
7511 }
7512
7513 // Si toujours pas d'image, charger l'image par défaut
7514 if (imgHotspotOriginal == null && strTypeHotspot != null && !strTypeHotspot.equals("gif")) {
7515 try {
7516 File fileHotspot = new File(getStrRepertAppli() + File.separator + "theme" + File.separator + "hotspots" + File.separator + strNomHotspot);
7517 if (fileHotspot.exists()) {
7518 Image imgTemp = new Image("file:" + fileHotspot.getAbsolutePath());
7519 // Vérifier que l'image est valide
7520 if (!imgTemp.isError() && imgTemp.getWidth() > 0 && imgTemp.getHeight() > 0) {
7522 System.out.println("Image par défaut chargée: " + fileHotspot.getAbsolutePath() + " (" + imgTemp.getWidth() + "x" + imgTemp.getHeight() + ")");
7523 // Stocker l'image source dans le hotspot
7525 } else {
7526 System.err.println("⚠️ Image par défaut invalide: " + fileHotspot.getAbsolutePath() + " (error=" + imgTemp.isError() + ", w=" + imgTemp.getWidth() + ", h=" + imgTemp.getHeight() + ")");
7527 }
7528 } else {
7529 System.err.println("⚠️ Fichier hotspot par défaut introuvable: " + fileHotspot.getAbsolutePath());
7530 }
7531 } catch (Exception e) {
7532 System.err.println("Erreur chargement image par défaut: " + e.getMessage());
7533 e.printStackTrace();
7534 }
7535 }
7536
7537 // Initialiser la couleur depuis le hotspot
7540 if (couleurPerso != null && !couleurPerso.isEmpty()) {
7541 String[] couleurParts = couleurPerso.split(";");
7542 if (couleurParts.length == 3) {
7543 try {
7544 double hue = Double.parseDouble(couleurParts[0]);
7545 double saturation = Double.parseDouble(couleurParts[1]);
7546 double brightness = Double.parseDouble(couleurParts[2]);
7548 } catch (NumberFormatException e) {
7549 couleurInitiale = Color.YELLOW; // Couleur par défaut
7550 }
7551 } else {
7552 couleurInitiale = Color.YELLOW;
7553 }
7554 } else {
7555 couleurInitiale = Color.YELLOW; // Couleur par défaut
7556 }
7558
7559 // Appliquer la couleur initiale à l'aperçu
7560 if (imgHotspotOriginal != null) {
7563 couleurInitiale.getHue(),
7564 couleurInitiale.getSaturation(),
7565 couleurInitiale.getBrightness()
7566 );
7567 if (imgApercuColoree != null) {
7569 } else {
7570 System.err.println("⚠️ Impossible de transformer la couleur de l'icône hotspot #" + io);
7571 }
7572 } else {
7573 System.err.println("⚠️ Image hotspot original null pour hotspot #" + io);
7574 }
7575
7576 // Mettre à jour l'aperçu quand la couleur change
7577 final int iNumHS = io;
7578 cpCouleurPerso.valueProperty().addListener((obs, oldVal, newVal) -> {
7579 System.out.println("\n=== Changement couleur Hotspot #" + iNumHS + " ===");
7580 System.out.println("Ancienne couleur: " + oldVal);
7581 System.out.println("Nouvelle couleur: " + newVal);
7582
7583 // DEBUG: Afficher le fichier actuellement enregistré dans le hotspot
7585 System.out.println("Fichier image dans hotspot AVANT changement: '" + fichierActuel + "'");
7586
7587 // IMPORTANT: Récupérer l'image source depuis le hotspot (pas depuis la variable locale!)
7589
7590 // DEBUG: Afficher quelle image est utilisée pour la transformation
7591 System.out.println("Image source pour transformation: " + (imgSourceDuHotspot != null ? "Image du hotspot" : "NULL"));
7592 if (imgSourceDuHotspot != null) {
7593 System.out.println(" Dimensions: " + imgSourceDuHotspot.getWidth() + "x" + imgSourceDuHotspot.getHeight());
7594 }
7595
7596 if (imgSourceDuHotspot != null && newVal != null) {
7599 newVal.getHue(),
7600 newVal.getSaturation(),
7601 newVal.getBrightness()
7602 );
7604
7605 // Mettre à jour aussi l'aperçu toujours visible en haut de la case
7606 ImageView ivApercuHS = (ImageView) vbPanneauHS.lookup("#ivApercuHS" + iNumHS);
7607 if (ivApercuHS != null) {
7608 ivApercuHS.setImage(imgApercuColoree);
7609 }
7610
7611 // Sauvegarder l'icône colorée et stocker le nom du fichier
7613 System.out.println("Fichier sauvegardé: " + nomFichier);
7614
7615 if (nomFichier != null) {
7617 System.out.println("Nom fichier stocké dans hotspot #" + iNumHS);
7618
7619 // DEBUG: Vérifier immédiatement
7621 System.out.println("Vérification immédiate - Fichier dans hotspot APRES: '" + verification + "'");
7622 } else {
7623 System.err.println("ERREUR: Nom de fichier NULL!");
7624 }
7625 } else {
7626 System.err.println("ERREUR: Image ou couleur NULL - imgSourceDuHotspot=" + imgSourceDuHotspot + ", newVal=" + newVal);
7627 }
7628 valideHS();
7629 });
7630
7631 // Action du bouton pour choisir une nouvelle icône (maintenant après les ColorPicker)
7632 final int iNumHotspot = io;
7633 btnChoisirIcone.setOnAction((@SuppressWarnings("unused") ActionEvent e) -> {
7635 fileChooser.setTitle(rbLocalisation.getString("main.choisirImageIcone"));
7636
7637 // Définir le répertoire initial : theme/hotspots pour les HS panoramiques
7638 File repertoireInitial = new File(getStrRepertAppli() + File.separator + "theme" + File.separator + "hotspots");
7639 if (repertoireInitial.exists() && repertoireInitial.isDirectory()) {
7640 fileChooser.setInitialDirectory(repertoireInitial);
7641 }
7642
7643 // Limiter aux fichiers PNG uniquement
7644 fileChooser.getExtensionFilters().add(
7645 new FileChooser.ExtensionFilter("PNG", "*.png")
7646 );
7647
7648 File fileChoisi = fileChooser.showOpenDialog(null);
7649 if (fileChoisi != null) {
7650 System.out.println("\n=== Sélection nouvelle icône Hotspot #" + iNumHotspot + " ===");
7651 System.out.println("Fichier choisi: " + fileChoisi.getAbsolutePath());
7652
7653 // DEBUG: Afficher l'état AVANT le changement
7655 System.out.println("strFichierImage AVANT chargement: '" + fichierAvant + "'");
7656
7657 try {
7658 // Vérifier que le fichier source existe
7659 if (!fileChoisi.exists()) {
7660 System.err.println("⚠️ Fichier source introuvable : " + fileChoisi.getAbsolutePath());
7661 return;
7662 }
7663
7664 // Charger l'image
7665 Image imgChoisie = new Image("file:" + fileChoisi.getAbsolutePath());
7666 System.out.println("Image chargée: " + imgChoisie.getWidth() + "x" + imgChoisie.getHeight());
7667
7668 // IMPORTANT: Stocker l'image source dans le hotspot
7670 System.out.println("Image source stockée dans le hotspot #" + iNumHotspot);
7671
7672 // Stocker le nom du fichier source original (sans chemin complet)
7675 System.out.println("Nom fichier source stocké: " + nomFichierSource);
7676
7677 // Obtenir la couleur actuelle du ColorPicker
7679 System.out.println("Couleur actuelle: " + couleurActuelle);
7680
7681 // Appliquer la couleur à l'image
7683 imgChoisie,
7684 couleurActuelle.getHue(),
7685 couleurActuelle.getSaturation(),
7686 couleurActuelle.getBrightness()
7687 );
7688
7689 // Sauvegarder l'image colorée
7691 System.out.println("Fichier sauvegardé: " + nomFichier);
7692
7693 if (nomFichier != null) {
7694 // Mettre à jour l'ImageView avec l'image colorée
7695 ivIconeActuelle.setImage(imgColoree);
7696
7697 // Mettre à jour l'aperçu de couleur aussi
7698 ivApercuCouleur.setImage(imgColoree);
7699
7700 // Mettre à jour aussi l'aperçu toujours visible en haut de la case
7701 ImageView ivApercuHS = (ImageView) vbPanneauHS.lookup("#ivApercuHS" + iNumHotspot);
7702 if (ivApercuHS != null) {
7703 ivApercuHS.setImage(imgColoree);
7704 }
7705
7706 // Sauvegarder le nom du fichier dans le hotspot
7708 System.out.println("Nom fichier stocké dans hotspot #" + iNumHotspot);
7709
7710 // DEBUG: Vérifier immédiatement APRES
7712 System.out.println("strFichierImage APRES chargement: '" + fichierApres + "'");
7713 System.out.println("Comparaison: AVANT='" + fichierAvant + "' vs APRES='" + fichierApres + "'");
7714
7715 valideHS();
7716 setbDejaSauve(false);
7717 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
7718 } else {
7719 System.err.println("ERREUR: Nom de fichier NULL après sauvegarde!");
7720 }
7721 } catch (Exception ex) {
7722 System.err.println("ERREUR lors du traitement de l'icône: ");
7723 ex.printStackTrace();
7724 }
7725 }
7726 });
7727
7728 // Créer un HBox pour aligner le ColorPicker et l'aperçu
7729 HBox hboxCouleur = new HBox(10);
7730 hboxCouleur.setTranslateX(10);
7731 hboxCouleur.getChildren().addAll(cpCouleurPerso, ivApercuCouleur);
7732
7733 // Ajouter tous les éléments de personnalisation dans le VBox pliable
7734 vbPersonnalisation.getChildren().addAll(
7735 sepPerso,
7740 cbAgrandit,
7743 );
7744
7745 // Ajouter les éléments au panneau principal
7746 vbPanneauHS.getChildren().addAll(hboxTitrePerso, vbPersonnalisation, lblSep1);
7747 vbHotspots.getChildren().addAll(paneHsPanoramique, lblSep);
7748 }
7749 @SuppressWarnings("unused")
7750 int iNbHS = io;
7751 @SuppressWarnings("unused")
7752 int iTaillePane = io * 385;
7753 for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspotImage(); io++) {
7754 Label lblSep = new Label(" ");
7755 Label lblSep1 = new Label(" ");
7756 VBox vbPanneauHsImage = new VBox();
7758 int iNum = io;
7759 Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (@SuppressWarnings("unused") ActionEvent event) -> {
7760 Circle c1 = (Circle) panePanoramique.lookup("#img" + iNum);
7761 if (c1 != null) {
7762 if (c1.getFill() == Color.BLUE) {
7763 c1.setFill(Color.YELLOW);
7764 c1.setStroke(Color.BLUE);
7765 } else {
7766 c1.setFill(Color.BLUE);
7767 c1.setStroke(Color.YELLOW);
7768 }
7769 }
7770 }));
7771 timBouge.setCycleCount(Timeline.INDEFINITE);
7772 timBouge.pause();
7773 paneHsImage.setOnMouseEntered((e) -> {
7774 timBouge.play();
7775 });
7776 paneHsImage.setOnMouseExited((e) -> {
7777 Circle c1 = (Circle) panePanoramique.lookup("#img" + iNum);
7778 if (c1 != null) {
7779
7780 c1.setFill(Color.BLUE);
7781 c1.setStroke(Color.YELLOW);
7782 }
7783 timBouge.pause();
7784 });
7785 paneHsImage.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;");
7786 paneHsImage.setId("HSImg" + io);
7787 lblPoint = new Label("Image #" + (io + 1));
7788 lblPoint.setPadding(new Insets(5, 10, 5, 5));
7789 lblPoint.getStyleClass().add("titreOutil");
7790 Separator sepHS = new Separator(Orientation.HORIZONTAL);
7791 sepHS.setPrefWidth(351);
7792 sepHS.setTranslateX(2);
7793
7794 paneHsImage.setPrefWidth(355);
7795 vbPanneauHsImage.getChildren().addAll(lblPoint, sepHS);
7796 Label lblLien = new Label(rbLocalisation.getString("main.imageChoisie"));
7797 lblLien.setTranslateX(10);
7798
7800 Image imgChoisie = new Image("file:" + getStrRepertTemp() + File.separator + "images" + File.separator + strF1XML);
7802 ivChoisie.setTranslateX(100);
7803 ivChoisie.setFitWidth(100);
7804 ivChoisie.setFitHeight(imgChoisie.getHeight() / imgChoisie.getWidth() * 100);
7805
7806 vbPanneauHsImage.getChildren().addAll(lblLien, ivChoisie, lblSep);
7807 Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot"));
7808 lblTexteHS.setTranslateX(10);
7809
7810 TextField tfTexteHS = new TextField();
7811 if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrInfo() != null) {
7812 tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrInfo());
7813 }
7814 tfTexteHS.textProperty().addListener((@SuppressWarnings("unused") final ObservableValue<? extends String> observable, @SuppressWarnings("unused") final String oldValue, @SuppressWarnings("unused") final String newValue) -> {
7815 valideHS();
7816 });
7817
7818 tfTexteHS.setId("txtHSImage" + io);
7819 tfTexteHS.setPrefSize(200, 25);
7820 tfTexteHS.setMaxSize(200, 20);
7821 tfTexteHS.setTranslateX(60);
7822
7823 // ComboBox pour le type d'animation
7824 Label lblTypeAnimationImage = new Label(rbLocalisation.getString("main.typeAnimation"));
7825 lblTypeAnimationImage.setTranslateX(10);
7827 cbTypeAnimationImage.setId("animeImage" + io);
7828 cbTypeAnimationImage.setTranslateX(10);
7829 cbTypeAnimationImage.setPrefWidth(200);
7830 cbTypeAnimationImage.getItems().addAll(
7831 "none",
7832 "pulse",
7833 "rotation",
7834 "desaturation",
7835 "bounce",
7836 "swing",
7837 "glow",
7838 "heartbeat",
7839 "shake",
7840 "flip",
7841 "wobble",
7842 "tada",
7843 "flash",
7844 "rubber",
7845 "jello",
7846 "neon",
7847 "float"
7848 );
7849 cbTypeAnimationImage.setValue(getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrTypeAnimation());
7850 cbTypeAnimationImage.valueProperty().addListener((obs, oldVal, newVal) -> {
7851 valideHS();
7852 });
7853
7854 // CheckBox pour Agrandissement au survol
7855 CheckBox cbAgranditImage = new CheckBox(rbLocalisation.getString("main.agrandissementSurvol"));
7856 cbAgranditImage.setId("agranditSurvolImage" + io);
7857 cbAgranditImage.setTranslateX(10);
7858 cbAgranditImage.setSelected(getPanoramiquesProjet()[iNumPano].getHotspotImage(io).isAgranditSurvol());
7859 cbAgranditImage.selectedProperty().addListener((obs, oldVal, newVal) -> {
7860 valideHS();
7861 });
7862
7863 // Label et ColorPicker pour couleur personnalisée hotspot
7864 Label lblCouleurPersoImage = new Label(rbLocalisation.getString("main.couleurPersonnalisee"));
7865 lblCouleurPersoImage.setPrefHeight(29);
7866 lblCouleurPersoImage.setMaxHeight(29);
7867 lblCouleurPersoImage.setPrefWidth(200);
7868 lblCouleurPersoImage.setTranslateX(10);
7869
7871 cpCouleurPersoImage.setId("couleurPersoImage" + io);
7872 cpCouleurPersoImage.setTranslateX(10);
7873 cpCouleurPersoImage.setPrefWidth(160);
7874
7875 // ImageView pour l'aperçu du hotspot image avec la couleur
7877 ivApercuCouleurImage.setId("apercuCouleurImage" + io);
7878 ivApercuCouleurImage.setFitWidth(32);
7879 ivApercuCouleurImage.setFitHeight(32);
7880 ivApercuCouleurImage.setPreserveRatio(true);
7881 ivApercuCouleurImage.setTranslateX(180);
7882
7883 // Charger l'image du hotspot image - utiliser l'icône source si disponible
7885 String strNomHotspotImage = (nomIconeSourceImage != null && !nomIconeSourceImage.isEmpty()) ? nomIconeSourceImage : strNomfichierHSImage;
7886
7887 // DEBUG
7888 System.out.println("🎨 DEBUG aperçu HotspotImage #" + io + ":");
7889 System.out.println(" - nomIconeSourceImage: " + nomIconeSourceImage);
7890 System.out.println(" - strNomfichierHSImage: " + strNomfichierHSImage);
7891 System.out.println(" - strNomHotspotImage utilisé: " + strNomHotspotImage);
7892
7893 String strTypeHotspotImage = strTypeHSImage;
7895 if (strTypeHotspotImage != null && !strTypeHotspotImage.equals("gif")) {
7896 try {
7897 File fileHotspotImage = new File(getStrRepertAppli() + File.separator + "theme" + File.separator + "hotspots" + File.separator + strNomHotspotImage);
7898 if (fileHotspotImage.exists()) {
7899 imgHotspotImageOriginal = new Image("file:" + fileHotspotImage.getAbsolutePath());
7900 }
7901 } catch (Exception e) {
7902 // Ignorer les erreurs de chargement
7903 }
7904 }
7905
7906 // Stocker l'image dans l'objet hotspot pour utilisation ultérieure
7908 System.out.println("Image source stockée dans objet HotspotImage #" + io);
7909
7910 // Initialiser la couleur depuis le hotspot
7913 if (couleurPersoImage != null && !couleurPersoImage.isEmpty()) {
7914 String[] couleurParts = couleurPersoImage.split(";");
7915 if (couleurParts.length == 3) {
7916 try {
7917 double hue = Double.parseDouble(couleurParts[0]);
7918 double saturation = Double.parseDouble(couleurParts[1]);
7919 double brightness = Double.parseDouble(couleurParts[2]);
7921 } catch (NumberFormatException e) {
7922 couleurInitialeImage = Color.RED; // Couleur par défaut pour images
7923 }
7924 } else {
7926 }
7927 } else {
7928 couleurInitialeImage = Color.RED; // Couleur par défaut pour images
7929 }
7931
7932 // Appliquer la couleur initiale à l'aperçu
7933 if (imgHotspotImageOriginal != null) {
7936 couleurInitialeImage.getHue(),
7937 couleurInitialeImage.getSaturation(),
7938 couleurInitialeImage.getBrightness()
7939 );
7941 }
7942
7943 // Mettre à jour l'aperçu quand la couleur change
7945 final int iNumHSImage = io;
7946 cpCouleurPersoImage.valueProperty().addListener((obs, oldVal, newVal) -> {
7947 if (imgHotspotImageFinal != null && newVal != null) {
7950 newVal.getHue(),
7951 newVal.getSaturation(),
7952 newVal.getBrightness()
7953 );
7955
7956 // Sauvegarder l'icône colorée et stocker le nom du fichier
7958 if (nomFichier != null) {
7960 }
7961 }
7962 valideHS();
7963 });
7964
7965 // Créer un HBox pour aligner le ColorPicker et l'aperçu
7966 HBox hboxCouleurImage = new HBox(10);
7967 hboxCouleurImage.setTranslateX(10);
7969
7971 Label lblCoulFond = new Label(rbLocalisation.getString("diapo.couleurFond"));
7972 lblCoulFond.setTranslateX(10);
7973 Label lblOpacite = new Label(rbLocalisation.getString("diapo.opacite"));
7974 lblOpacite.setTranslateX(10);
7975 if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrCouleurFond().equals("")) {
7977 "#" + getGestionnaireInterface().getCouleurFondTheme().toString().substring(2, 8)
7978 );
7979 }
7980 ColorPicker cpCouleurFond = new ColorPicker(Color.valueOf(getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrCouleurFond()));
7981 if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getOpacite() == -1) {
7983 }
7984 cpCouleurFond.setTranslateX(100);
7985 int i = io;
7986 cpCouleurFond.valueProperty().addListener((ov, av, nv) -> {
7987 if (getiNombrePanoramiques() != 0) {
7988 setbDejaSauve(false);
7989 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
7990 }
7991 getPanoramiquesProjet()[iNumPano].getHotspotImage(i).setStrCouleurFond("#" + cpCouleurFond.getValue().toString().substring(2, 8));
7992 });
7993 Slider slOpacite = new Slider(0, 1, getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getOpacite());
7994 slOpacite.valueProperty().addListener((ov, av, nv) -> {
7995 if (getiNombrePanoramiques() != 0) {
7996 setbDejaSauve(false);
7997 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
7998 }
7999 getPanoramiquesProjet()[iNumPano].getHotspotImage(i).setOpacite(slOpacite.getValue());
8000 });
8001 slOpacite.setTranslateX(100);
8002 slOpacite.setPrefWidth(130);
8003 slOpacite.setMinWidth(130);
8004 slOpacite.setMaxWidth(130);
8005 vbPanneauHsImage.getChildren().addAll(lblCoulFond, cpCouleurFond, lblOpacite, slOpacite);
8006
8007 vbHotspots.getChildren().addAll(paneHsImage, lblSep);
8008 iTaillePane += 365 + ivChoisie.getFitHeight();
8009 paneHsImage.setPrefHeight(340 + ivChoisie.getFitHeight());
8010 paneHsImage.setMinHeight(340 + ivChoisie.getFitHeight());
8011 paneHsImage.setMaxHeight(340 + ivChoisie.getFitHeight());
8012 }
8013
8014 iNbHS += io;
8015
8016 for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspotHTML(); io++) {
8017 Label lblSep = new Label(" ");
8018 int iNum = io;
8019 VBox vbPanneauHS = new VBox();
8021 Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (@SuppressWarnings("unused") ActionEvent event) -> {
8022 Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum);
8023 if (c1 != null) {
8024
8025 if (c1.getFill() == Color.DARKGREEN) {
8026 c1.setFill(Color.YELLOWGREEN);
8027 c1.setStroke(Color.DARKGREEN);
8028 } else {
8029 c1.setFill(Color.DARKGREEN);
8030 c1.setStroke(Color.YELLOWGREEN);
8031 }
8032 }
8033 }));
8034 timBouge.setCycleCount(Timeline.INDEFINITE);
8035 timBouge.pause();
8036 paneHsHtml.setOnMouseEntered((e) -> {
8037 timBouge.play();
8038 });
8039 paneHsHtml.setOnMouseExited((e) -> {
8040 timBouge.pause();
8041 Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum);
8042 if (c1 != null) {
8043 c1.setFill(Color.DARKGREEN);
8044 c1.setStroke(Color.YELLOWGREEN);
8045 }
8046 });
8047 paneHsHtml.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;");
8048 paneHsHtml.setId("HSHTML" + io);
8049 lblPoint = new Label("Hotspot HTML #" + (io + 1));
8050 lblPoint.setPadding(new Insets(5, 10, 5, 5));
8051 lblPoint.getStyleClass().add("titreOutil");
8052 Separator sepHS = new Separator(Orientation.HORIZONTAL);
8053 sepHS.setPrefWidth(351);
8054 sepHS.setTranslateX(2);
8055 paneHsHtml.setPrefWidth(355);
8056 Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot"));
8057 lblTexteHS.setTranslateX(10);
8058 TextField tfTexteHS = new TextField();
8059 if (getPanoramiquesProjet()[iNumPano].getHotspotHTML(io).getStrInfo() != null) {
8060 tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotHTML(io).getStrInfo());
8061 }
8062 tfTexteHS.textProperty().addListener((@SuppressWarnings("unused") final ObservableValue<? extends String> observable, @SuppressWarnings("unused") final String oldValue, @SuppressWarnings("unused") final String newValue) -> {
8063 valideHS();
8064 });
8065
8066 tfTexteHS.setId("txtHSHTML" + io);
8067 tfTexteHS.setPrefSize(200, 25);
8068 tfTexteHS.setMaxSize(200, 20);
8069 tfTexteHS.setTranslateX(60);
8070
8071 // ComboBox pour le type d'animation
8072 Label lblTypeAnimationHTML = new Label(rbLocalisation.getString("main.typeAnimation"));
8073 lblTypeAnimationHTML.setTranslateX(10);
8075 cbTypeAnimationHTML.setId("animeHTML" + io);
8076 cbTypeAnimationHTML.setTranslateX(10);
8077 cbTypeAnimationHTML.setPrefWidth(200);
8078 cbTypeAnimationHTML.getItems().addAll(
8079 "none",
8080 "pulse",
8081 "rotation",
8082 "desaturation",
8083 "bounce",
8084 "swing",
8085 "glow",
8086 "heartbeat",
8087 "shake",
8088 "flip",
8089 "wobble",
8090 "tada",
8091 "flash",
8092 "rubber",
8093 "jello",
8094 "neon",
8095 "float"
8096 );
8097 cbTypeAnimationHTML.setValue(getPanoramiquesProjet()[iNumPano].getHotspotHTML(io).getStrTypeAnimation());
8098 cbTypeAnimationHTML.valueProperty().addListener((obs, oldVal, newVal) -> {
8099 valideHS();
8100 });
8101
8102 // CheckBox pour Agrandissement au survol
8103 CheckBox cbAgranditHTML = new CheckBox(rbLocalisation.getString("main.agrandissementSurvol"));
8104 cbAgranditHTML.setId("agranditSurvolHTML" + io);
8105 cbAgranditHTML.setTranslateX(10);
8106 cbAgranditHTML.setSelected(getPanoramiquesProjet()[iNumPano].getHotspotHTML(io).isAgranditSurvol());
8107 cbAgranditHTML.selectedProperty().addListener((obs, oldVal, newVal) -> {
8108 valideHS();
8109 });
8110
8111 // Label et ColorPicker pour couleur personnalisée hotspot HTML
8112 Label lblCouleurPersoHTML = new Label(rbLocalisation.getString("main.couleurPersonnalisee"));
8113 lblCouleurPersoHTML.setPrefHeight(29);
8114 lblCouleurPersoHTML.setMaxHeight(29);
8115 lblCouleurPersoHTML.setPrefWidth(200);
8116 lblCouleurPersoHTML.setTranslateX(10);
8117
8119 cpCouleurPersoHTML.setId("couleurPersoHTML" + io);
8120 cpCouleurPersoHTML.setTranslateX(10);
8121 cpCouleurPersoHTML.setPrefWidth(160);
8122
8123 // ImageView pour l'aperçu du hotspot HTML avec la couleur
8125 ivApercuCouleurHTML.setId("apercuCouleurHTML" + io);
8126 ivApercuCouleurHTML.setFitWidth(32);
8127 ivApercuCouleurHTML.setFitHeight(32);
8128 ivApercuCouleurHTML.setPreserveRatio(true);
8129 ivApercuCouleurHTML.setTranslateX(180);
8130
8131 // Charger l'image du hotspot HTML - utiliser l'icône source si disponible
8133 String strNomHotspotHTML = (nomIconeSourceHTML != null && !nomIconeSourceHTML.isEmpty()) ? nomIconeSourceHTML : strNomfichierHSHTML;
8134
8135 // DEBUG
8136 System.out.println("🎨 DEBUG aperçu HotspotHTML #" + io + ":");
8137 System.out.println(" - nomIconeSourceHTML: " + nomIconeSourceHTML);
8138 System.out.println(" - strNomfichierHSHTML: " + strNomfichierHSHTML);
8139 System.out.println(" - strNomHotspotHTML utilisé: " + strNomHotspotHTML);
8140
8141 String strTypeHotspotHTML = strTypeHSHTML;
8143 if (strTypeHotspotHTML != null && !strTypeHotspotHTML.equals("gif")) {
8144 try {
8145 File fileHotspotHTML = new File(getStrRepertAppli() + File.separator + "theme" + File.separator + "hotspots" + File.separator + strNomHotspotHTML);
8146 if (fileHotspotHTML.exists()) {
8147 imgHotspotHTMLOriginal = new Image("file:" + fileHotspotHTML.getAbsolutePath());
8148 }
8149 } catch (Exception e) {
8150 // Ignorer les erreurs de chargement
8151 }
8152 }
8153
8154 // Stocker l'image dans l'objet hotspot pour utilisation ultérieure
8156 System.out.println("Image source stockée dans objet HotspotHTML #" + io);
8157
8158 // Initialiser la couleur depuis le hotspot
8161 if (couleurPersoHTML != null && !couleurPersoHTML.isEmpty()) {
8162 String[] couleurParts = couleurPersoHTML.split(";");
8163 if (couleurParts.length == 3) {
8164 try {
8165 double hue = Double.parseDouble(couleurParts[0]);
8166 double saturation = Double.parseDouble(couleurParts[1]);
8167 double brightness = Double.parseDouble(couleurParts[2]);
8169 } catch (NumberFormatException e) {
8170 couleurInitialeHTML = Color.GREEN; // Couleur par défaut pour HTML
8171 }
8172 } else {
8173 couleurInitialeHTML = Color.GREEN;
8174 }
8175 } else {
8176 couleurInitialeHTML = Color.GREEN; // Couleur par défaut pour HTML
8177 }
8179
8180 // Appliquer la couleur initiale à l'aperçu
8181 if (imgHotspotHTMLOriginal != null) {
8184 couleurInitialeHTML.getHue(),
8185 couleurInitialeHTML.getSaturation(),
8186 couleurInitialeHTML.getBrightness()
8187 );
8189 }
8190
8191 // Mettre à jour l'aperçu quand la couleur change
8193 final int iNumHSHTML = io;
8194 cpCouleurPersoHTML.valueProperty().addListener((obs, oldVal, newVal) -> {
8195 if (imgHotspotHTMLFinal != null && newVal != null) {
8198 newVal.getHue(),
8199 newVal.getSaturation(),
8200 newVal.getBrightness()
8201 );
8203
8204 // Sauvegarder l'icône colorée et stocker le nom du fichier
8206 if (nomFichier != null) {
8208 }
8209 }
8210 valideHS();
8211 });
8212
8213 // Créer un HBox pour aligner le ColorPicker et l'aperçu
8214 HBox hboxCouleurHTML = new HBox(10);
8215 hboxCouleurHTML.setTranslateX(10);
8217
8219 Button btnEditeHSHTML = new Button(rbLocalisation.getString("main.editeHTML"));
8220 btnEditeHSHTML.setPrefWidth(80);
8221 btnEditeHSHTML.setTranslateX(paneHsHtml.getPrefWidth() - btnEditeHSHTML.getPrefWidth() - 10);
8222 vbPanneauHS.getChildren().addAll(btnEditeHSHTML);
8224 .setOnAction((e) -> {
8227 editHTML.setHsHTML(HS);
8228 Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
8229 int iHauteur = (int) tailleEcran.getHeight() - 100;
8230 int iLargeur = (int) tailleEcran.getWidth() - 100;
8231 editHTML.affiche(iLargeur, iHauteur);
8232 editHTML.addPropertyChangeListener("bValide", (ev) -> {
8233 if (ev.getNewValue().toString().equals("true")) {
8234 getPanoramiquesProjet()[iNumPano].setHotspotHTML(editHTML.getHsHTML(), iNum);
8235 dejaCharge = false;
8237 Pane affHS1 = paneAffichageHS(strListePano(), iNumPano);
8238 affHS1.setId("labels");
8239 vbVisuHotspots.getChildren().add(affHS1);
8240 }
8241 });
8242
8243 });
8244
8245 vbHotspots.getChildren().addAll(paneHsHtml, lblSep);
8246 paneHsHtml.setPrefHeight(260);
8247 paneHsHtml.setMinHeight(260);
8248 paneHsHtml.setMaxHeight(260);
8249 iTaillePane += 285;
8250 }
8251 iNbHS += io;
8252 for (io = 0; io < getPanoramiquesProjet()[iNumPano].getiNombreHotspotDiapo(); io++) {
8253 Label lblSep = new Label(" ");
8254 int iNum = io;
8255 VBox vbPanneauHS = new VBox();
8257 Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (@SuppressWarnings("unused") ActionEvent event) -> {
8258 Circle c1 = (Circle) panePanoramique.lookup("#dia" + iNum);
8259 if (c1 != null) {
8260
8261 if (c1.getFill() == Color.TURQUOISE) {
8262 c1.setFill(Color.ORANGE);
8263 c1.setStroke(Color.TURQUOISE);
8264 } else {
8265 c1.setFill(Color.TURQUOISE);
8266 c1.setStroke(Color.ORANGE);
8267 }
8268 }
8269 }));
8270 timBouge.setCycleCount(Timeline.INDEFINITE);
8271 timBouge.pause();
8272 paneHsDiapo.setOnMouseEntered((e) -> {
8273 timBouge.play();
8274 });
8275 paneHsDiapo.setOnMouseExited((e) -> {
8276 timBouge.pause();
8277 Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum);
8278 if (c1 != null) {
8279 c1.setFill(Color.TURQUOISE);
8280 c1.setStroke(Color.ORANGE);
8281 }
8282 });
8283 paneHsDiapo.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;");
8284 paneHsDiapo.setId("DIAPO" + io);
8285 lblPoint = new Label("Hotspot Diaporama #" + (io + 1));
8286 lblPoint.setPadding(new Insets(5, 10, 5, 5));
8287 lblPoint.getStyleClass().add("titreOutil");
8288 Separator sepHS = new Separator(Orientation.HORIZONTAL);
8289 sepHS.setPrefWidth(321);
8290 sepHS.setTranslateX(2);
8291 paneHsDiapo.setPrefWidth(325);
8292 Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot"));
8293 lblTexteHS.setTranslateX(10);
8294 TextField tfTexteHS = new TextField();
8295 if (getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getStrInfo() != null) {
8296 tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getStrInfo());
8297 }
8298 tfTexteHS.textProperty().addListener((@SuppressWarnings("unused") final ObservableValue<? extends String> observable, final String oldValue, @SuppressWarnings("unused") final String newValue) -> {
8299 valideHS();
8300 });
8301
8302 tfTexteHS.setId("txtDIA" + io);
8303 tfTexteHS.setPrefSize(200, 25);
8304 tfTexteHS.setMaxSize(200, 20);
8305 tfTexteHS.setTranslateX(60);
8306 vbPanneauHS.getChildren().addAll(lblPoint, sepHS, lblTexteHS, tfTexteHS);
8308 for (int i = 0; i < getiNombreDiapo(); i++) {
8309 cbListeDiapo.getItems().add(diaporamas[i].getStrNomDiaporama());
8310 }
8311 cbListeDiapo.getSelectionModel().select(getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getiNumDiapo());
8312 int iii = io;
8313 cbListeDiapo.getSelectionModel().selectedIndexProperty().addListener((ov, av, nv) -> {
8315 });
8316 cbListeDiapo.setTranslateX(60);
8317 vbPanneauHS.getChildren().addAll(cbListeDiapo);
8318//Ajouter Liste Diaporamas
8319 vbHotspots.getChildren().addAll(paneHsDiapo, lblSep);
8320 paneHsDiapo.setPrefHeight(120);
8321 paneHsDiapo.setMinHeight(120);
8322 paneHsDiapo.setMaxHeight(120);
8323 iTaillePane += 145;
8324 }
8325 valideHS();
8326 iNbHS += io;
8327 dejaCharge = true;
8328 paneHotSpots.setId("labels");
8329
8330 // Le ScrollPane gérera automatiquement la hauteur
8331
8332 return paneHotSpots;
8333 }
8334
8338 private static void ajouteAffichageHotspots() {
8339 Pane paneLabels = (Pane) vbVisuHotspots.lookup("#labels");
8340 vbVisuHotspots.getChildren().remove(paneLabels);
8341 dejaCharge = false;
8343 paneLabels.setId("labels");
8344 vbVisuHotspots.getChildren().add(paneLabels);
8345 setiNumPoints(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspots());
8346 setiNumImages(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotImage());
8347 setiNumHTML(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotHTML());
8348 if (apHS1.getApOutil().isVisible()) {
8351 }
8352 }
8353
8358 private static ScrollPane spAfficheLegende() {
8359 double positionX;
8360 double positionY;
8363 spLegende.getStyleClass().add("legendePane");
8364
8365 apLegende.setMinWidth(1000);
8366 apLegende.setMinHeight(150);
8367 apLegende.setPrefWidth(1000);
8368 apLegende.setPrefHeight(150);
8369 apLegende.setMaxWidth(1000);
8370 apLegende.setMaxHeight(150);
8371 positionY = (spVuePanoramique.getPrefHeight() - apLegende.getPrefHeight() - 15);
8372
8373 Circle circPoint = new Circle(30, 20, 5);
8374 circPoint.setFill(Color.YELLOW);
8375 circPoint.setStroke(Color.RED);
8376 circPoint.setCursor(Cursor.DEFAULT);
8377 Circle circPoint2 = new Circle(30, 40, 5);
8378 circPoint2.setFill(Color.BLUE);
8379 circPoint2.setStroke(Color.YELLOW);
8380 circPoint2.setCursor(Cursor.DEFAULT);
8381 Circle circPoint3 = new Circle(30, 60, 5);
8382 circPoint3.setFill(Color.GREEN);
8383 circPoint3.setStroke(Color.YELLOW);
8384 circPoint3.setCursor(Cursor.DEFAULT);
8386 polygonCroix.getPoints().addAll(new Double[]{
8387 15.0, 2.0,
8388 2.0, 2.0,
8389 2.0, 15.0,
8390 -2.0, 15.0,
8391 -2.0, 2.0,
8392 -15.0, 2.0,
8393 -15.0, -2.0,
8394 -2.0, -2.0,
8395 -2.0, -15.0,
8396 2.0, -15.0,
8397 2.0, -2.0,
8398 15.0, -2.0
8399 });
8400 polygonCroix.setStrokeLineJoin(StrokeLineJoin.MITER);
8401 polygonCroix.setFill(Color.BLUEVIOLET);
8402 polygonCroix.setStroke(Color.YELLOW);
8403 polygonCroix.setId("PoV");
8404 polygonCroix.setLayoutX(500);
8405 polygonCroix.setLayoutY(20);
8406 Label lblHS = new Label(rbLocalisation.getString("main.legendeHS"));
8407 Label lblHSImage = new Label(rbLocalisation.getString("main.legendeHSImage"));
8408 Label lblHSHTML = new Label(rbLocalisation.getString("main.legendeHSHTML"));
8409 Label lblPoV = new Label(rbLocalisation.getString("main.legendePoV"));
8410 Label lblNord = new Label(rbLocalisation.getString("main.legendeNord"));
8411 Line lineNord = new Line(500, 45, 500, 65);
8412 lineNord.setStroke(Color.RED);
8413 lineNord.setStrokeWidth(3);
8414 lblHS.setLayoutX(50);
8415 lblHS.setLayoutY(15);
8416 lblHSImage.setLayoutX(50);
8417 lblHSImage.setLayoutY(35);
8418 lblHSHTML.setLayoutX(50);
8419 lblHSHTML.setLayoutY(55);
8420 lblPoV.setLayoutX(520);
8421 lblPoV.setLayoutY(15);
8422 lblNord.setLayoutX(520);
8423 lblNord.setLayoutY(55);
8425 apLegende.setId("legende");
8426 apLegende.setVisible(true);
8427 if (largeurMax - 50 < 1004) {
8428 spLegende.setPrefWidth(largeurMax - 50);
8429 spLegende.setMaxWidth(largeurMax - 50);
8430 positionX = 25;
8431 } else {
8432 spLegende.setPrefWidth(1004);
8433 spLegende.setMaxWidth(1004);
8434 positionX = (largeurMax - 1004) / 2.d;
8435 }
8436 spLegende.setLayoutX(positionX);
8437 spLegende.setLayoutY(positionY);
8438 spLegende.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
8439 spLegende.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
8440
8441 return spLegende;
8442 }
8443
8450 private static void afficheHS(int i, double longitude, double latitude) {
8451 double largeur = ivImagePanoramique.getFitWidth();
8452 double hauteur = ivImagePanoramique.getFitHeight();
8453 double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
8454 double Y = (90.0d - latitude) * hauteur / 180.0d;
8455 Circle circPoint = new Circle(X, Y, 5);
8456 circPoint.setFill(Color.YELLOW);
8457 circPoint.setStroke(Color.RED);
8458 circPoint.setId("point" + i);
8459 circPoint.setCursor(Cursor.DEFAULT);
8460 panePanoramique.getChildren().add(circPoint);
8461
8462 Tooltip tltpHotSpot = new Tooltip("point #" + (i + 1));
8463 tltpHotSpot.setStyle(getStrTooltipStyle());
8464 Tooltip.install(circPoint, tltpHotSpot);
8465 circPoint.setOnDragDetected((mouseEvent1) -> {
8466 circPoint.setFill(Color.RED);
8467 circPoint.setStroke(Color.YELLOW);
8468 bDragDrop = true;
8469 mouseEvent1.consume();
8470
8471 });
8472 circPoint.setOnMouseDragged((mouseEvent1) -> {
8473 double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
8474 if (XX < 0) {
8475 XX = 0;
8476 }
8477 if (XX > ivImagePanoramique.getFitWidth()) {
8478 XX = ivImagePanoramique.getFitWidth();
8479 }
8480 circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
8481 double YY = mouseEvent1.getY();
8482 if (YY < 0) {
8483 YY = 0;
8484 }
8485 if (YY > ivImagePanoramique.getFitHeight()) {
8486 YY = ivImagePanoramique.getFitHeight();
8487 }
8488 circPoint.setCenterY(YY);
8489 afficheLoupe(XX, YY);
8490 mouseEvent1.consume();
8491
8492 });
8493 circPoint.setOnMouseReleased((mouseEvent1) -> {
8494 String strChPoint = circPoint.getId();
8495 strChPoint = strChPoint.substring(5, strChPoint.length());
8496 int iNumeroPoint = Integer.parseInt(strChPoint);
8497 double X1 = mouseEvent1.getSceneX();
8498 double Y1 = mouseEvent1.getY(); // Coordonnées locales du panePanoramique
8499 double mouseX = X1 - ivImagePanoramique.getLayoutX();
8500 if (mouseX < 0) {
8501 mouseX = 0;
8502 }
8503 if (mouseX > ivImagePanoramique.getFitWidth()) {
8504 mouseX = ivImagePanoramique.getFitWidth();
8505 }
8506
8507 double mouseY = Y1; // Y déjà en coordonnées locales
8508 if (mouseY < 0) {
8509 mouseY = 0;
8510 }
8511 if (mouseY > ivImagePanoramique.getFitHeight()) {
8512 mouseY = ivImagePanoramique.getFitHeight();
8513 }
8514
8515 double longit, lat;
8516 double larg = ivImagePanoramique.getFitWidth();
8518 longit = 360.0f * mouseX / larg - 180;
8519 lat = 90.0d - (mouseY / ivImagePanoramique.getFitHeight()) * 180.0f;
8522 circPoint.setFill(Color.YELLOW);
8523 circPoint.setStroke(Color.RED);
8524 mouseEvent1.consume();
8525
8526 });
8527
8528 circPoint.setOnMouseClicked((mouseEvent1) -> {
8529 String strPoint = circPoint.getId();
8530 strPoint = strPoint.substring(5, strPoint.length());
8531 int numeroPoint = Integer.parseInt(strPoint);
8533 nodePoint = (Node) panePanoramique.lookup("#point" + strPoint);
8534
8535 if (mouseEvent1.isControlDown()) {
8536 setbDejaSauve(false);
8537 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
8538 panePanoramique.getChildren().remove(nodePoint);
8539
8540 for (int io = numeroPoint + 1; io < getiNumPoints(); io++) {
8541 nodePoint = (Node) panePanoramique.lookup("#point" + Integer.toString(io));
8542 nodePoint.setId("point" + Integer.toString(io - 1));
8543 }
8547 dejaCharge = false;
8555 mouseEvent1.consume();
8556 valideHS();
8557 } else {
8558 if (!bDragDrop) {
8559 if (getiNombrePanoramiques() > 1) {
8561 double positX = (panePanoramique.getPrefWidth() - apListePanoVig.getPrefWidth()) / 2.d;
8562 double positY = (panePanoramique.getPrefHeight() - apListePanoVig.getPrefHeight()) / 2.d;
8563 apListePanoVig.setLayoutX(positX);
8564 apListePanoVig.setLayoutY(positY);
8565 apPanneauPrincipal.getChildren().add(apListePanoVig);
8566 }
8567 } else {
8568 bDragDrop = false;
8569 }
8570 valideHS();
8571 mouseEvent1.consume();
8572
8573 }
8574
8575 });
8576 }
8577
8584 private static void afficheHSImage(int i, double longitude, double latitude) {
8585 double largeur = ivImagePanoramique.getFitWidth();
8586 double hauteur = ivImagePanoramique.getFitHeight();
8587 double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
8588 double Y = (90.0d - latitude) * hauteur / 180.0d;
8589 Circle circPoint = new Circle(X, Y, 5);
8590 circPoint.setFill(Color.BLUE);
8591 circPoint.setStroke(Color.YELLOW);
8592 circPoint.setId("img" + i);
8593 circPoint.setCursor(Cursor.DEFAULT);
8594 panePanoramique.getChildren().add(circPoint);
8595 Tooltip tltpHSImage = new Tooltip("image #" + (i + 1));
8596 tltpHSImage.setStyle(getStrTooltipStyle());
8597 Tooltip.install(circPoint, tltpHSImage);
8598 circPoint.setOnDragDetected((mouseEvent1) -> {
8599 circPoint.setFill(Color.YELLOW);
8600 circPoint.setStroke(Color.BLUE);
8601 bDragDrop = true;
8602 mouseEvent1.consume();
8603
8604 });
8605 circPoint.setOnMouseDragged((mouseEvent1) -> {
8606 double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
8607 if (XX < 0) {
8608 XX = 0;
8609 }
8610 if (XX > ivImagePanoramique.getFitWidth()) {
8611 XX = ivImagePanoramique.getFitWidth();
8612 }
8613 circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
8614 double YY = mouseEvent1.getY();
8615 if (YY < 0) {
8616 YY = 0;
8617 }
8618 if (YY > ivImagePanoramique.getFitHeight()) {
8619 YY = ivImagePanoramique.getFitHeight();
8620 }
8621 circPoint.setCenterY(YY);
8622 afficheLoupe(XX, YY);
8623 mouseEvent1.consume();
8624
8625 });
8626 circPoint.setOnMouseReleased((mouseEvent1) -> {
8627 String strPoint = circPoint.getId();
8628 strPoint = strPoint.substring(3, strPoint.length());
8629 int iNumeroPoint = Integer.parseInt(strPoint);
8630 double X1 = mouseEvent1.getSceneX();
8631 double Y1 = mouseEvent1.getY(); // Coordonnées locales du panePanoramique
8632 double mouseX = X1 - ivImagePanoramique.getLayoutX();
8633 if (mouseX < 0) {
8634 mouseX = 0;
8635 }
8636 if (mouseX > ivImagePanoramique.getFitWidth()) {
8637 mouseX = ivImagePanoramique.getFitWidth();
8638 }
8639 double mouseY = Y1; // Y déjà en coordonnées locales
8640 if (mouseY < 0) {
8641 mouseY = 0;
8642 }
8643 if (mouseY > ivImagePanoramique.getFitHeight()) {
8644 mouseY = ivImagePanoramique.getFitHeight();
8645 }
8646
8647 double longit, lat;
8648 double larg = ivImagePanoramique.getFitWidth();
8650 longit = 360.0f * mouseX / larg - 180;
8651 lat = 90.0d - (mouseY / ivImagePanoramique.getFitHeight()) * 180.0f;
8654 circPoint.setFill(Color.BLUE);
8655 circPoint.setStroke(Color.YELLOW);
8656 mouseEvent1.consume();
8657
8658 });
8659
8660 circPoint.setOnMouseClicked((mouseEvent1) -> {
8661 String strPoint = circPoint.getId();
8662 strPoint = strPoint.substring(3, strPoint.length());
8663 int iNum = Integer.parseInt(strPoint);
8665 nodePointImage = (Node) panePanoramique.lookup("#img" + strPoint);
8666
8667 if (mouseEvent1.isControlDown()) {
8668 valideHS();
8669 setbDejaSauve(false);
8670 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
8671 panePanoramique.getChildren().remove(nodePointImage);
8672
8673 for (int io = iNum + 1; io < getiNumImages(); io++) {
8674 nodePointImage = (Node) panePanoramique.lookup("#img" + Integer.toString(io));
8675 nodePointImage.setId("img" + Integer.toString(io - 1));
8676 }
8687 mouseEvent1.consume();
8688 } else {
8689 if (!bDragDrop) {
8691 if (getStrRepertHSImages().equals("")) {
8692 fileRepert = new File(getStrCurrentDir() + File.separator);
8693 } else {
8695 }
8697 FileChooser.ExtensionFilter extFilterImages = new FileChooser.ExtensionFilter("Fichiers Images (jpg, bmp, png)", "*.jpg", "*.bmp", "*.png");
8698
8699 fileChooser.setInitialDirectory(fileRepert);
8700 fileChooser.getExtensionFilters().addAll(extFilterImages);
8701
8702 File fileFichierImage = fileChooser.showOpenDialog(null);
8703 if (fileFichierImage != null) {
8706 HS.setStrUrlImage(fileFichierImage.getAbsolutePath());
8707 HS.setStrLienImg(fileFichierImage.getName());
8708 HS.setStrInfo(fileFichierImage.getName().split("\\.")[0]);
8709 File fileRepertImage = new File(getStrRepertTemp() + File.separator + "images");
8710 if (!fileRepertImage.exists()) {
8711 fileRepertImage.mkdirs();
8712 }
8713 try {
8714 copieFichierRepertoire(fileFichierImage.getAbsolutePath(), fileRepertImage.getAbsolutePath());
8715
8716 } catch (IOException ex) {
8717 Logger.getLogger(EditeurPanovisu.class
8718 .getName()).log(Level.SEVERE, null, ex);
8719 }
8723 affHS1.setId("labels");
8724 vbVisuHotspots.getChildren().add(affHS1);
8725 }
8726 } else {
8727 bDragDrop = false;
8728 }
8729 mouseEvent1.consume();
8730 }
8731
8732 });
8733 }
8734
8741 private static void afficheHSDiapo(int i, double longitude, double latitude) {
8742 double largeur = ivImagePanoramique.getFitWidth();
8743 double hauteur = ivImagePanoramique.getFitHeight();
8744 double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
8745 double Y = (90.0d - latitude) * hauteur / 180.0d;
8746 Circle circPoint = new Circle(X, Y, 5);
8747 circPoint.setFill(Color.TURQUOISE);
8748 circPoint.setStroke(Color.ORANGE);
8749 circPoint.setId("dia" + i);
8750 circPoint.setCursor(Cursor.DEFAULT);
8751 panePanoramique.getChildren().add(circPoint);
8752 Tooltip tltpHSImage = new Tooltip("Diaporama #" + (i + 1));
8753 tltpHSImage.setStyle(getStrTooltipStyle());
8754 Tooltip.install(circPoint, tltpHSImage);
8755 circPoint.setOnDragDetected((mouseEvent1) -> {
8756 circPoint.setFill(Color.ORANGE);
8757 circPoint.setStroke(Color.TURQUOISE);
8758 bDragDrop = true;
8759 mouseEvent1.consume();
8760
8761 });
8762 circPoint.setOnMouseDragged((mouseEvent1) -> {
8763 double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
8764 if (XX < 0) {
8765 XX = 0;
8766 }
8767 if (XX > ivImagePanoramique.getFitWidth()) {
8768 XX = ivImagePanoramique.getFitWidth();
8769 }
8770 circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
8771 double YY = mouseEvent1.getY();
8772 if (YY < 0) {
8773 YY = 0;
8774 }
8775 if (YY > ivImagePanoramique.getFitHeight()) {
8776 YY = ivImagePanoramique.getFitHeight();
8777 }
8778 circPoint.setCenterY(YY);
8779 afficheLoupe(XX, YY);
8780 mouseEvent1.consume();
8781
8782 });
8783 circPoint.setOnMouseReleased((mouseEvent1) -> {
8784 String strPoint = circPoint.getId();
8785 strPoint = strPoint.substring(3, strPoint.length());
8786 int iNumeroPoint = Integer.parseInt(strPoint);
8787 double X1 = mouseEvent1.getSceneX();
8788 double Y1 = mouseEvent1.getY(); // Coordonnées locales du panePanoramique
8789 double mouseX = X1 - ivImagePanoramique.getLayoutX();
8790 if (mouseX < 0) {
8791 mouseX = 0;
8792 }
8793 if (mouseX > ivImagePanoramique.getFitWidth()) {
8794 mouseX = ivImagePanoramique.getFitWidth();
8795 }
8796 double mouseY = Y1; // Y déjà en coordonnées locales
8797 if (mouseY < 0) {
8798 mouseY = 0;
8799 }
8800 if (mouseY > ivImagePanoramique.getFitHeight()) {
8801 mouseY = ivImagePanoramique.getFitHeight();
8802 }
8803
8804 double longit, lat;
8805 double larg = ivImagePanoramique.getFitWidth();
8807 longit = 360.0f * mouseX / larg - 180;
8808 lat = 90.0d - (mouseY / ivImagePanoramique.getFitHeight()) * 180.0f;
8811 circPoint.setFill(Color.TURQUOISE);
8812 circPoint.setStroke(Color.ORANGE);
8813 mouseEvent1.consume();
8814
8815 });
8816
8817 circPoint.setOnMouseClicked((mouseEvent1) -> {
8818 String strPoint = circPoint.getId();
8819 strPoint = strPoint.substring(3, strPoint.length());
8820 int iNum = Integer.parseInt(strPoint);
8822 nodePointDiapo = (Node) panePanoramique.lookup("#dia" + strPoint);
8823
8824 if (mouseEvent1.isControlDown()) {
8825 valideHS();
8826 setbDejaSauve(false);
8827 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
8828 panePanoramique.getChildren().remove(nodePointDiapo);
8829
8830 for (int io = iNum + 1; io < getiNumDiapo(); io++) {
8831 nodePointDiapo = (Node) panePanoramique.lookup("#dia" + Integer.toString(io));
8832 nodePointDiapo.setId("dia" + Integer.toString(io - 1));
8833 }
8844 mouseEvent1.consume();
8845 } else {
8846 if (!bDragDrop) {
8848 for (int ii = 0; ii < getiNombreDiapo(); ii++) {
8849 choixDiapo1.add(diaporamas[ii].getStrNomDiaporama());
8850 }
8852 dialog1.setTitle(rbLocalisation.getString("main.choixDiapo"));
8853 dialog1.setHeaderText(null);
8854 dialog1.setContentText(rbLocalisation.getString("main.diapos"));
8855
8856// Traditional way to get the response value.
8857 Optional<String> result1 = dialog1.showAndWait();
8858 if (result1.isPresent()) {
8859 boolean bTrouve = false;
8860 int iTrouve = -1;
8861 for (int ii = 0; ii < getiNombreDiapo(); ii++) {
8862 if (diaporamas[ii].getStrNomDiaporama().equals(result1.get())) {
8863 bTrouve = true;
8864 iTrouve = ii;
8865 }
8866 }
8867 if (bTrouve) {
8870 valideHS();
8872 }
8873 }
8874 } else {
8875 bDragDrop = false;
8876 }
8877 mouseEvent1.consume();
8878 }
8879
8880 });
8881 }
8882
8889 private static void afficheHSHTML(int i, double longitude, double latitude) {
8890 double largeur = ivImagePanoramique.getFitWidth();
8891 double hauteur = ivImagePanoramique.getFitHeight();
8892 double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
8893 double Y = (90.0d - latitude) * hauteur / 180.0d;
8894 Circle circPoint = new Circle(X, Y, 5);
8895 circPoint.setFill(Color.DARKGREEN);
8896 circPoint.setStroke(Color.YELLOWGREEN);
8897 circPoint.setId("html" + i);
8898 circPoint.setCursor(Cursor.DEFAULT);
8899 panePanoramique.getChildren().add(circPoint);
8900 Tooltip tltpHSImage = new Tooltip("HTML #" + (i + 1));
8901 tltpHSImage.setStyle(getStrTooltipStyle());
8902 Tooltip.install(circPoint, tltpHSImage);
8903 circPoint.setOnDragDetected((mouseEvent1) -> {
8904 circPoint.setFill(Color.YELLOWGREEN);
8905 circPoint.setStroke(Color.DARKGREEN);
8906 bDragDrop = true;
8907 mouseEvent1.consume();
8908
8909 });
8910 circPoint.setOnMouseDragged((mouseEvent1) -> {
8911 double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
8912 if (XX < 0) {
8913 XX = 0;
8914 }
8915 if (XX > ivImagePanoramique.getFitWidth()) {
8916 XX = ivImagePanoramique.getFitWidth();
8917 }
8918 circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
8919 double YY = mouseEvent1.getY();
8920 if (YY < 0) {
8921 YY = 0;
8922 }
8923 if (YY > ivImagePanoramique.getFitHeight()) {
8924 YY = ivImagePanoramique.getFitHeight();
8925 }
8926 circPoint.setCenterY(YY);
8927 afficheLoupe(XX, YY);
8928 mouseEvent1.consume();
8929
8930 });
8931 circPoint.setOnMouseReleased((mouseEvent1) -> {
8932 String strPoint = circPoint.getId();
8933 strPoint = strPoint.substring(4, strPoint.length());
8934 int iNumeroPoint = Integer.parseInt(strPoint);
8935 double X1 = mouseEvent1.getSceneX();
8936 double Y1 = mouseEvent1.getY(); // Coordonnées locales du panePanoramique
8937 double mouseX = X1 - ivImagePanoramique.getLayoutX();
8938 if (mouseX < 0) {
8939 mouseX = 0;
8940 }
8941 if (mouseX > ivImagePanoramique.getFitWidth()) {
8942 mouseX = ivImagePanoramique.getFitWidth();
8943 }
8944 double mouseY = Y1; // Y déjà en coordonnées locales
8945 if (mouseY < 0) {
8946 mouseY = 0;
8947 }
8948 if (mouseY > ivImagePanoramique.getFitHeight()) {
8949 mouseY = ivImagePanoramique.getFitHeight();
8950 }
8951
8952 double longit, lat;
8953 double larg = ivImagePanoramique.getFitWidth();
8955 longit = 360.0f * mouseX / larg - 180;
8956 lat = 90.0d - (mouseY / ivImagePanoramique.getFitHeight()) * 180.0f;
8959 circPoint.setFill(Color.DARKGREEN);
8960 circPoint.setStroke(Color.YELLOWGREEN);
8961 mouseEvent1.consume();
8962
8963 });
8964
8965 circPoint.setOnMouseClicked((mouseEvent1) -> {
8966 String strPoint = circPoint.getId();
8967 strPoint = strPoint.substring(4, strPoint.length());
8968 int iNum = Integer.parseInt(strPoint);
8970 nodePointImage = (Node) panePanoramique.lookup("#html" + strPoint);
8971
8972 if (mouseEvent1.isControlDown()) {
8973 valideHS();
8974 setbDejaSauve(false);
8975 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
8976 panePanoramique.getChildren().remove(nodePointImage);
8977
8978 for (int io = iNum + 1; io < getiNumImages(); io++) {
8979 nodePointImage = (Node) panePanoramique.lookup("#html" + Integer.toString(io));
8980 nodePointImage.setId("img" + Integer.toString(io - 1));
8981 }
8986 setiNumHTML(getiNumHTML() - 1);
8992 mouseEvent1.consume();
8993 } else {
8994 if (!bDragDrop) {
8997 editHTML.setHsHTML(HS);
8998 Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
8999 int iHauteur = (int) tailleEcran.getHeight() - 100;
9000 int iLargeur = (int) tailleEcran.getWidth() - 100;
9001 editHTML.affiche(iLargeur, iHauteur);
9002 editHTML.addPropertyChangeListener("bValide", (ev) -> {
9003 if (ev.getNewValue().toString().equals("true")) {
9005 dejaCharge = false;
9008 affHS1.setId("labels");
9009 vbVisuHotspots.getChildren().add(affHS1);
9010 }
9011 });
9012 } else {
9013 bDragDrop = false;
9014 }
9015 mouseEvent1.consume();
9016 }
9017
9018 });
9019 }
9020
9024 private static void ajouteAffichagePointsHotspots() {
9025
9026 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspots(); i++) {
9029 afficheHS(i, longitude, latitude);
9030 }
9031 setiNumPoints(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspots());
9032
9033 }
9034
9039 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotImage(); i++) {
9042 afficheHSImage(i, longitude, latitude);
9043 }
9044 setiNumImages(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotImage());
9045
9046 }
9047
9052 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getiNombreHotspotDiapo(); i++) {
9055 afficheHSDiapo(i, longitude, latitude);
9056 }
9057 setiNumDiapo(getPanoramiquesProjet()[getiPanoActuel()].getiNombreHotspotDiapo());
9058
9059 }
9060
9065 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotHTML(); i++) {
9068 afficheHSHTML(i, longitude, latitude);
9069 }
9070 setiNumHTML(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotHTML());
9071
9072 }
9073
9078 if (!isbDejaSauve()) {
9079 projetSauve();
9080 }
9081 }
9082
9088 private static void panoChoixRegard(double X, double Y) {
9089 if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
9090 double mouseX = X;
9091 double mouseY = Y; // Y est déjà en coordonnées locales du panePanoramique
9092 double largeur = ivImagePanoramique.getFitWidth();
9093 double hauteur = ivImagePanoramique.getFitHeight();
9094 double regardX = 360.0f * mouseX / largeur - 180;
9095 double regardY = 90.0d - (mouseY / hauteur) * 180.0f;
9098 navigateurPanoramique.setLongitude(regardX - 180);
9102
9103 affichePoV(regardX, regardY, getPanoramiquesProjet()[getiPanoActuel()].getChampVisuel());
9104 }
9105 }
9106
9111 private static void panoChoixNord(double X) {
9112 if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
9113 double mouseX = X;
9114 double largeur = ivImagePanoramique.getFitWidth();
9115 double regardX = 360.0f * mouseX / largeur - 180;
9117 navigateurPanoramique.setPositNord(regardX - 180);
9119 afficheNord(regardX);
9120 }
9121 }
9122
9127 private static void afficheNord(double longitude) {
9128 double largeur = ivImagePanoramique.getFitWidth();
9129 double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
9130 Node nodeAncienNord = (Node) panePanoramique.lookup("#Nord");
9131 if (nodeAncienNord != null) {
9132 panePanoramique.getChildren().remove(nodeAncienNord);
9133 }
9134 Line lineNord = new Line(0, 0, 0, ivImagePanoramique.getFitHeight());
9135 lineNord.setCursor(Cursor.DEFAULT);
9136
9137 lineNord.setLayoutX(X);
9138 lineNord.setStroke(Color.RED);
9139 lineNord.setStrokeWidth(4);
9140 lineNord.setId("Nord");
9141 lineNord.setOnDragDetected((mouseEvent1) -> {
9142 lineNord.setStroke(Color.BLUEVIOLET);
9143 bDragDrop = true;
9144 mouseEvent1.consume();
9145 });
9146 lineNord.setOnMouseDragged((me1) -> {
9147
9148 double XX = me1.getSceneX() - ivImagePanoramique.getLayoutX();
9149 if (XX < 0) {
9150 XX = 0;
9151 }
9152 if (XX > ivImagePanoramique.getFitWidth()) {
9153 XX = ivImagePanoramique.getFitWidth();
9154 }
9155 lineNord.setLayoutX(XX + ivImagePanoramique.getLayoutX());
9156 me1.consume();
9157 double YY = me1.getY();
9158 afficheLoupe(XX, YY);
9159 });
9160 lineNord.setOnMouseReleased((me1) -> {
9161 double X1 = me1.getSceneX();
9162 double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
9163 if (mouseX1 < 0) {
9164 mouseX1 = 0;
9165 }
9166 if (mouseX1 > ivImagePanoramique.getFitWidth()) {
9167 mouseX1 = ivImagePanoramique.getFitWidth();
9168 }
9169 double regardX = 360.0f * mouseX1 / largeur - 180;
9170 navigateurPanoramique.setPositNord(regardX - 180);
9173 lineNord.setStroke(Color.RED);
9174 me1.consume();
9175
9176 });
9177
9178 panePanoramique.getChildren().add(lineNord);
9179 }
9180
9188 private static void affichePoV(double longitude, double latitude, double fov) {
9189 double largeur = ivImagePanoramique.getFitWidth();
9190 double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
9191 double Y = (90.0d - latitude) * largeur / 360.0d;
9192 Node nodeAncienPoV = (Node) panePanoramique.lookup("#PoV");
9193 if (nodeAncienPoV != null) {
9194 panePanoramique.getChildren().remove(nodeAncienPoV);
9195 }
9196 Polygon plgPoV = new Polygon();
9197 plgPoV.getPoints().addAll(new Double[]{
9198 20.0, 2.0,
9199 2.0, 2.0,
9200 2.0, 20.0,
9201 -2.0, 20.0,
9202 -2.0, 2.0,
9203 -20.0, 2.0,
9204 -20.0, -2.0,
9205 -2.0, -2.0,
9206 -2.0, -20.0,
9207 2.0, -20.0,
9208 2.0, -2.0,
9209 20.0, -2.0
9210 });
9211 plgPoV.setStrokeLineJoin(StrokeLineJoin.MITER);
9212 plgPoV.setFill(Color.BLUEVIOLET);
9213 plgPoV.setStroke(Color.YELLOW);
9214 plgPoV.setId("PoV");
9215 plgPoV.setLayoutX(X);
9216 plgPoV.setLayoutY(Y);
9217 plgPoV.setCursor(Cursor.DEFAULT);
9218 plgPoV.setOnDragDetected((mouseEvent1) -> {
9219 plgPoV.setFill(Color.YELLOW);
9220 plgPoV.setStroke(Color.BLUEVIOLET);
9221 bDragDrop = true;
9222 mouseEvent1.consume();
9223
9224 });
9225 plgPoV.setOnMouseDragged((mouseEvent1) -> {
9226
9227 double XX = mouseEvent1.getSceneX() - ivImagePanoramique.getLayoutX();
9228 if (XX < 0) {
9229 XX = 0;
9230 }
9231 if (XX > ivImagePanoramique.getFitWidth()) {
9232 XX = ivImagePanoramique.getFitWidth();
9233 }
9234 plgPoV.setLayoutX(XX + ivImagePanoramique.getLayoutX());
9235 double YY = mouseEvent1.getSceneY() - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
9236 if (YY < 0) {
9237 YY = 0;
9238 }
9239 if (YY > ivImagePanoramique.getFitHeight()) {
9240 YY = ivImagePanoramique.getFitHeight();
9241 }
9242 plgPoV.setLayoutY(YY);
9243 afficheLoupe(XX, YY);
9244 mouseEvent1.consume();
9245
9246 });
9247 plgPoV.setOnMouseReleased((mouseEvent1) -> {
9248 double X1 = mouseEvent1.getSceneX();
9249 double Y1 = mouseEvent1.getSceneY();
9250 double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
9251 if (mouseX1 < 0) {
9252 mouseX1 = 0;
9253 }
9254 if (mouseX1 > ivImagePanoramique.getFitWidth()) {
9255 mouseX1 = ivImagePanoramique.getFitWidth();
9256 }
9257 double mouseY1 = Y1 - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
9258 if (mouseY1 < 0) {
9259 mouseY1 = 0;
9260 }
9261 if (mouseY1 > ivImagePanoramique.getFitHeight()) {
9262 mouseY1 = ivImagePanoramique.getFitHeight();
9263 }
9264 double regardX = 360.0f * mouseX1 / largeur - 180;
9265 double regardY = 90.0d - 2.0f * mouseY1 / largeur * 180.0f;
9266 navigateurPanoramique.setLongitude(regardX - 180);
9272 plgPoV.setFill(Color.BLUEVIOLET);
9273 plgPoV.setStroke(Color.YELLOW);
9274 mouseEvent1.consume();
9275
9276 });
9277
9278 panePanoramique.getChildren().add(plgPoV);
9279 }
9280
9286 private static void panoMouseClic(double X, double Y) {
9287
9288 if (getiNombrePanoramiques() > 1) {
9289 valideHS();
9290 setbDejaSauve(false);
9291 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9292 double mouseX = X;
9293 double mouseY = Y; // Y est déjà en coordonnées locales du panePanoramique
9294 if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
9295 double longitude, latitude;
9296 double largeur = ivImagePanoramique.getFitWidth();
9297 double hauteur = ivImagePanoramique.getFitHeight();
9299 longitude = 360.0f * mouseX / largeur - 180;
9300 latitude = 90.0d - (mouseY / hauteur) * 180.0f;
9301 Circle circPoint = new Circle(mouseX + ivImagePanoramique.getLayoutX(), mouseY, 5);
9302 circPoint.setFill(Color.YELLOW);
9303 circPoint.setStroke(Color.RED);
9304 circPoint.setId("point" + getiNumPoints());
9305 circPoint.setCursor(Cursor.DEFAULT);
9306 panePanoramique.getChildren().add(circPoint);
9307 Tooltip tltpPoint = new Tooltip("point n°" + (getiNumPoints() + 1));
9308 tltpPoint.setStyle(getStrTooltipStyle());
9309 Tooltip.install(circPoint, tltpPoint);
9310 HotSpot HS = new HotSpot();
9311 HS.setLongitude(longitude);
9312 HS.setLatitude(latitude);
9313 HS.setStrTypeAnimation(getGestionnaireInterface().getStrTypeAnimationPanoDefaut());
9314 HS.setAgranditSurvol(getGestionnaireInterface().isbHotspotsPanoAgrandisDefaut());
9317 dejaCharge = false;
9319 paneAfficheHS1.setId("labels");
9320 vbVisuHotspots.getChildren().add(paneAfficheHS1);
9321 spPanneauOutils.setVvalue(spPanneauOutils.getVvalue() + 300);
9323 if (getiNombrePanoramiques() > 1) {
9324
9326 double positX = (panePanoramique.getPrefWidth() - apListePanoVig.getPrefWidth()) / 2.d;
9327 double positY = (panePanoramique.getPrefHeight() - apListePanoVig.getPrefHeight()) / 2.d;
9328 apListePanoVig.setLayoutX(positX);
9329 apListePanoVig.setLayoutY(positY);
9330 apPanneauPrincipal.getChildren().add(apListePanoVig);
9331 valideHS();
9332 }
9333 circPoint.setOnDragDetected((mouseEvent1) -> {
9334 String strPoint = circPoint.getId();
9335 strPoint = strPoint.substring(5, strPoint.length());
9336 int numeroPoint = Integer.parseInt(strPoint);
9338 nodePoint = (Node) panePanoramique.lookup("#point" + strPoint);
9339 circPoint.setFill(Color.RED);
9340 circPoint.setStroke(Color.YELLOW);
9341 bDragDrop = true;
9342 mouseEvent1.consume();
9343
9344 });
9345 circPoint.setOnMouseDragged((mouseEvent1) -> {
9346 double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
9347 if (XX < 0) {
9348 XX = 0;
9349 }
9350 if (XX > ivImagePanoramique.getFitWidth()) {
9351 XX = ivImagePanoramique.getFitWidth();
9352 }
9353 circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
9354 double YY = mouseEvent1.getY();
9355 if (YY < 0) {
9356 YY = 0;
9357 }
9358 if (YY > ivImagePanoramique.getFitHeight()) {
9359 YY = ivImagePanoramique.getFitHeight();
9360 }
9361 circPoint.setCenterY(YY);
9362 afficheLoupe(XX, YY);
9363 mouseEvent1.consume();
9364
9365 });
9366 circPoint.setOnMouseReleased((mouseEvent1) -> {
9367 setbDejaSauve(false);
9368 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9369 String strPoint = circPoint.getId();
9370 strPoint = strPoint.substring(5, strPoint.length());
9371 int iNumeroPoint = Integer.parseInt(strPoint);
9372 double X1 = mouseEvent1.getSceneX();
9373 double Y1 = mouseEvent1.getY(); // Coordonnées locales du panePanoramique
9374 double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
9375 if (mouseX1 < 0) {
9376 mouseX1 = 0;
9377 }
9378 if (mouseX1 > ivImagePanoramique.getFitWidth()) {
9379 mouseX1 = ivImagePanoramique.getFitWidth();
9380 }
9381 double mouseY1 = Y1; // Y déjà en coordonnées locales
9382 if (mouseY1 < 0) {
9383 mouseY1 = 0;
9384 }
9385 if (mouseY1 > ivImagePanoramique.getFitHeight()) {
9386 mouseY1 = ivImagePanoramique.getFitHeight();
9387 }
9388 double longit, lat;
9389 double larg = ivImagePanoramique.getFitWidth();
9390 longit = 360.0f * mouseX1 / larg - 180;
9391 lat = 90.0d - (mouseY1 / ivImagePanoramique.getFitHeight()) * 180.0f;
9394 circPoint.setFill(Color.YELLOW);
9395 circPoint.setStroke(Color.RED);
9396 mouseEvent1.consume();
9397
9398 });
9399
9400 circPoint.setOnMouseClicked((mouseEvent1) -> {
9401 if (mouseEvent1.isControlDown()) {
9402 setbDejaSauve(false);
9403 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9404 String strPoint = circPoint.getId();
9405 strPoint = strPoint.substring(5, strPoint.length());
9406 int iNumeroPoint = Integer.parseInt(strPoint);
9408 nodePoint = (Node) panePanoramique.lookup("#point" + strPoint);
9409 panePanoramique.getChildren().remove(nodePoint);
9410
9411 for (int io = iNumeroPoint + 1; io < getiNumPoints(); io++) {
9412 nodePoint = (Node) panePanoramique.lookup("#point" + Integer.toString(io));
9413 nodePoint.setId("point" + Integer.toString(io - 1));
9414 }
9425 valideHS();
9426 mouseEvent1.consume();
9427 } else {
9428 if (!bDragDrop) {
9429 setbDejaSauve(false);
9430 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9431 String strPoint = circPoint.getId();
9432 strPoint = strPoint.substring(5, strPoint.length());
9433 int iNumeroPoint = Integer.parseInt(strPoint);
9434 if (getiNombrePanoramiques() > 1) {
9436 double positX = (panePanoramique.getPrefWidth() - apListePanoVig.getPrefWidth()) / 2.d;
9437 double positY = (panePanoramique.getPrefHeight() - apListePanoVig.getPrefHeight()) / 2.d;
9438 apListePanoVig.setLayoutX(positX);
9439 apListePanoVig.setLayoutY(positY);
9440 apPanneauPrincipal.getChildren().add(apListePanoVig);
9441 }
9442 } else {
9443 bDragDrop = false;
9444 }
9445 valideHS();
9446 mouseEvent1.consume();
9447
9448 }
9449 });
9450 }
9451 }
9452 }
9453
9459 private static void panoAjouteImage(double X, double Y) {
9460 if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
9461 valideHS();
9462 setbDejaSauve(false);
9463 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9464
9465 double mouseX = X;
9466 double mouseY = Y; // Y est déjà en coordonnées locales du panePanoramique
9467 double longitude, latitude;
9468 double largeur = ivImagePanoramique.getFitWidth();
9469 double hauteur = ivImagePanoramique.getFitHeight();
9470 longitude = 360.0f * mouseX / largeur - 180;
9471 latitude = 90.0d - (mouseY / hauteur) * 180.0f;
9472 Circle circPoint = new Circle(mouseX + ivImagePanoramique.getLayoutX(), mouseY, 5);
9473 circPoint.setFill(Color.BLUE);
9474 circPoint.setStroke(Color.YELLOW);
9475 circPoint.setId("img" + getiNumImages());
9476 circPoint.setCursor(Cursor.DEFAULT);
9477 panePanoramique.getChildren().add(circPoint);
9478 Tooltip tltpImage = new Tooltip("image n° " + (getiNumImages() + 1));
9479 tltpImage.setStyle(getStrTooltipStyle());
9480 Tooltip.install(circPoint, tltpImage);
9482 if (getStrRepertHSImages().equals("")) {
9483 fileRepert = new File(getStrCurrentDir() + File.separator);
9484 } else {
9486 }
9488 FileChooser.ExtensionFilter extFilterImages = new FileChooser.ExtensionFilter("Fichiers Images (jpg, bmp, png)", "*.jpg", "*.bmp", "*.png");
9489
9490 fileChooser.setInitialDirectory(fileRepert);
9491 fileChooser.getExtensionFilters().addAll(extFilterImages);
9492
9493 File fileFichierImage = fileChooser.showOpenDialog(null);
9494 if (fileFichierImage != null) {
9498 HS.setLongitude(longitude);
9499 HS.setLatitude(latitude);
9500 HS.setStrUrlImage(fileFichierImage.getAbsolutePath());
9501 HS.setStrLienImg(fileFichierImage.getName());
9502 HS.setStrInfo(fileFichierImage.getName().split("\\.")[0]);
9503 HS.setStrTypeAnimation(getGestionnaireInterface().getStrTypeAnimationPhotoDefaut());
9504 HS.setAgranditSurvol(getGestionnaireInterface().isbHotspotsPhotoAgrandisDefaut());
9505 File fileRepertImage = new File(getStrRepertTemp() + File.separator + "images");
9506 if (!fileRepertImage.exists()) {
9507 fileRepertImage.mkdirs();
9508 }
9509 try {
9510 copieFichierRepertoire(fileFichierImage.getAbsolutePath(), fileRepertImage.getAbsolutePath());
9511
9512 } catch (IOException ex) {
9513 Logger.getLogger(EditeurPanovisu.class
9514 .getName()).log(Level.SEVERE, null, ex);
9515 }
9518 dejaCharge = false;
9520 affHS1.setId("labels");
9521 vbVisuHotspots.getChildren().add(affHS1);
9522 spPanneauOutils.setVvalue(spPanneauOutils.getVvalue() + 300);
9523
9524 } else {
9525 String strPoint = circPoint.getId();
9526 strPoint = strPoint.substring(3, strPoint.length());
9527 Node nodeImage = (Node) panePanoramique.lookup("#img" + strPoint);
9528 panePanoramique.getChildren().remove(nodeImage);
9529 }
9530 valideHS();
9531 circPoint.setOnDragDetected((mouseEvent1) -> {
9532 circPoint.setFill(Color.YELLOW);
9533 circPoint.setStroke(Color.BLUE);
9534 bDragDrop = true;
9535 mouseEvent1.consume();
9536
9537 });
9538 circPoint.setOnMouseDragged((mouseEvent1) -> {
9539 double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
9540 if (XX < 0) {
9541 XX = 0;
9542 }
9543 if (XX > ivImagePanoramique.getFitWidth()) {
9544 XX = ivImagePanoramique.getFitWidth();
9545 }
9546 circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
9547 double YY = mouseEvent1.getY();
9548 if (YY < 0) {
9549 YY = 0;
9550 }
9551 if (YY > ivImagePanoramique.getFitHeight()) {
9552 YY = ivImagePanoramique.getFitHeight();
9553 }
9554 circPoint.setCenterY(YY);
9555 afficheLoupe(XX, YY);
9556
9557 mouseEvent1.consume();
9558
9559 });
9560 circPoint.setOnMouseReleased((mouseEvent1) -> {
9561 setbDejaSauve(false);
9562 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9563 String strPoint = circPoint.getId();
9564 strPoint = strPoint.substring(3, strPoint.length());
9565 int iNumeroPoint = Integer.parseInt(strPoint);
9566 double X1 = mouseEvent1.getSceneX();
9567 double Y1 = mouseEvent1.getY(); // Coordonnées locales du panePanoramique
9568 double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
9569 if (mouseX1 < 0) {
9570 mouseX1 = 0;
9571 }
9572 if (mouseX1 > ivImagePanoramique.getFitWidth()) {
9573 mouseX1 = ivImagePanoramique.getFitWidth();
9574 }
9575
9576 double mouseY1 = Y1; // Y déjà en coordonnées locales
9577 if (mouseY1 < 0) {
9578 mouseY1 = 0;
9579 }
9580 if (mouseY1 > ivImagePanoramique.getFitHeight()) {
9581 mouseY1 = ivImagePanoramique.getFitHeight();
9582 }
9583
9584 double longit, lat;
9585 double larg = ivImagePanoramique.getFitWidth();
9586 longit = 360.0f * mouseX1 / larg - 180;
9587 lat = 90.0d - (mouseY1 / ivImagePanoramique.getFitHeight()) * 180.0f;
9590 circPoint.setFill(Color.BLUE);
9591 circPoint.setStroke(Color.YELLOW);
9592 mouseEvent1.consume();
9593
9594 });
9595
9596 circPoint.setOnMouseClicked((mouseEvent1) -> {
9597 String strPoint = circPoint.getId();
9598 strPoint = strPoint.substring(3, strPoint.length());
9599 int iNum = Integer.parseInt(strPoint);
9600 if (mouseEvent1.isControlDown()) {
9601 setbDejaSauve(false);
9602 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9604 nodeImage = (Node) panePanoramique.lookup("#img" + strPoint);
9605 panePanoramique.getChildren().remove(nodeImage);
9606
9607 for (int io = iNum + 1; io < getiNumImages(); io++) {
9608 nodeImage = (Node) panePanoramique.lookup("#img" + Integer.toString(io));
9609 nodeImage.setId("img" + Integer.toString(io - 1));
9610 }
9621 } else {
9622 if (!bDragDrop) {
9623 setbDejaSauve(false);
9624 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9626 if (getStrRepertHSImages().equals("")) {
9627 fileRepert1 = new File(getStrCurrentDir() + File.separator);
9628 } else {
9630 }
9632 FileChooser.ExtensionFilter extFilterImages1 = new FileChooser.ExtensionFilter("Fichiers Images (jpg, bmp, png)", "*.jpg", "*.bmp", "*.png");
9633
9634 fileChooser1.setInitialDirectory(fileRepert1);
9635 fileChooser1.getExtensionFilters().addAll(extFilterImages1);
9636
9637 File fileFichierImage1 = fileChooser1.showOpenDialog(null);
9638 if (fileFichierImage1 != null) {
9641 HS.setStrUrlImage(fileFichierImage1.getAbsolutePath());
9642 HS.setStrLienImg(fileFichierImage1.getName());
9643 HS.setStrInfo(fileFichierImage1.getName().split("\\.")[0]);
9644 File fileRepertImage = new File(getStrRepertTemp() + File.separator + "images");
9645 if (!fileRepertImage.exists()) {
9646 fileRepertImage.mkdirs();
9647 }
9648 try {
9649 copieFichierRepertoire(fileFichierImage1.getAbsolutePath(), fileRepertImage.getAbsolutePath());
9650
9651 } catch (IOException ex) {
9652 Logger.getLogger(EditeurPanovisu.class
9653 .getName()).log(Level.SEVERE, null, ex);
9654 }
9657 dejaCharge = false;
9659 affHS1.setId("labels");
9660 vbVisuHotspots.getChildren().add(affHS1);
9661 }
9662 } else {
9663 bDragDrop = false;
9664 }
9665 }
9666 valideHS();
9667 mouseEvent1.consume();
9668 });
9669
9670 }
9671 }
9672
9678 private static void panoAjouteHTML(double X, double Y) {
9679 if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
9680 valideHS();
9681 setbDejaSauve(false);
9682 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9683 double mouseX = X;
9684 double mouseY = Y; // Y est déjà en coordonnées locales du panePanoramique
9685 double longitude, latitude;
9686 double largeur = ivImagePanoramique.getFitWidth();
9687 double hauteur = ivImagePanoramique.getFitHeight();
9688 longitude = 360.0f * mouseX / largeur - 180;
9689 latitude = 90.0d - (mouseY / hauteur) * 180.0f;
9690 Circle circPoint = new Circle(mouseX + ivImagePanoramique.getLayoutX(), mouseY, 5);
9691 circPoint.setFill(Color.DARKGREEN);
9692 circPoint.setStroke(Color.YELLOWGREEN);
9693 circPoint.setId("html" + getiNumHTML());
9694 circPoint.setCursor(Cursor.DEFAULT);
9695 panePanoramique.getChildren().add(circPoint);
9696 Tooltip tltpImage = new Tooltip("HTML n° " + (getiNumHTML() + 1));
9697 tltpImage.setStyle(getStrTooltipStyle());
9698 Tooltip.install(circPoint, tltpImage);
9700 HotspotHTML HS = new HotspotHTML();
9701 editHTML.setHsHTML(HS);
9702 HS.setLongitude(longitude);
9703 HS.setLatitude(latitude);
9704 HS.setStrTypeAnimation(getGestionnaireInterface().getStrTypeAnimationHTMLDefaut());
9705 HS.setAgranditSurvol(getGestionnaireInterface().isbHotspotsHTMLAgrandisDefaut());
9706 Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
9707 int iHauteur = (int) tailleEcran.getHeight() - 100;
9708 int iLargeur = (int) tailleEcran.getWidth() - 100;
9709
9710 editHTML.affiche(iLargeur, iHauteur);
9711
9712 editHTML.addPropertyChangeListener("bValide", (e) -> {
9713 if (e.getNewValue().toString().equals("true")) {
9714 setiNumHTML(getiNumHTML() + 1);
9717 dejaCharge = false;
9719 affHS1.setId("labels");
9720 vbVisuHotspots.getChildren().add(affHS1);
9721 spPanneauOutils.setVvalue(spPanneauOutils.getVvalue() + 145);
9722 }
9723 });
9724 editHTML.addPropertyChangeListener("bAnnule", (e) -> {
9725 if (e.getNewValue().toString().equals("true")) {
9726 String strPoint = circPoint.getId();
9727 strPoint = strPoint.substring(4, strPoint.length());
9728 Node nodeImage = (Node) panePanoramique.lookup("#html" + strPoint);
9729 panePanoramique.getChildren().remove(nodeImage);
9730 }
9731 });
9732
9733 valideHS();
9734 circPoint.setOnDragDetected((mouseEvent1) -> {
9735 circPoint.setFill(Color.YELLOWGREEN);
9736 circPoint.setStroke(Color.DARKGREEN);
9737 bDragDrop = true;
9738 mouseEvent1.consume();
9739
9740 });
9741 circPoint.setOnMouseDragged((mouseEvent1) -> {
9742 double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
9743 if (XX < 0) {
9744 XX = 0;
9745 }
9746 if (XX > ivImagePanoramique.getFitWidth()) {
9747 XX = ivImagePanoramique.getFitWidth();
9748 }
9749 circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
9750 double YY = mouseEvent1.getY();
9751 if (YY < 0) {
9752 YY = 0;
9753 }
9754 if (YY > ivImagePanoramique.getFitHeight()) {
9755 YY = ivImagePanoramique.getFitHeight();
9756 }
9757 circPoint.setCenterY(YY);
9758 afficheLoupe(XX, YY);
9759 mouseEvent1.consume();
9760
9761 });
9762 circPoint.setOnMouseReleased((mouseEvent1) -> {
9763 setbDejaSauve(false);
9764 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9765 String strPoint = circPoint.getId();
9766 strPoint = strPoint.substring(4, strPoint.length());
9767 int iNumeroPoint = Integer.parseInt(strPoint);
9768 double X1 = mouseEvent1.getSceneX();
9769 double Y1 = mouseEvent1.getY(); // Coordonnées locales du panePanoramique
9770 double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
9771 if (mouseX1 < 0) {
9772 mouseX1 = 0;
9773 }
9774 if (mouseX1 > ivImagePanoramique.getFitWidth()) {
9775 mouseX1 = ivImagePanoramique.getFitWidth();
9776 }
9777
9778 double mouseY1 = Y1; // Y déjà en coordonnées locales
9779 if (mouseY1 < 0) {
9780 mouseY1 = 0;
9781 }
9782 if (mouseY1 > ivImagePanoramique.getFitHeight()) {
9783 mouseY1 = ivImagePanoramique.getFitHeight();
9784 }
9785
9786 double longit, lat;
9787 double larg = ivImagePanoramique.getFitWidth();
9788 longit = 360.0f * mouseX1 / larg - 180;
9789 lat = 90.0d - (mouseY1 / ivImagePanoramique.getFitHeight()) * 180.0f;
9792 circPoint.setFill(Color.DARKGREEN);
9793 circPoint.setStroke(Color.YELLOWGREEN);
9794 mouseEvent1.consume();
9795
9796 });
9797
9798 circPoint.setOnMouseClicked((mouseEvent1) -> {
9799 String strPoint = circPoint.getId();
9800 strPoint = strPoint.substring(4, strPoint.length());
9801 int iNum = Integer.parseInt(strPoint);
9802 if (mouseEvent1.isControlDown()) {
9803 setbDejaSauve(false);
9804 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9806 nodeImage = (Node) panePanoramique.lookup("#html" + strPoint);
9807 panePanoramique.getChildren().remove(nodeImage);
9808
9809 for (int io = iNum + 1; io < getiNumHTML(); io++) {
9810 nodeImage = (Node) panePanoramique.lookup("#html" + Integer.toString(io));
9811 nodeImage.setId("html" + Integer.toString(io - 1));
9812 }
9817 setiNumHTML(getiNumHTML() - 1);
9823 } else {
9824 if (!bDragDrop) {
9825 setbDejaSauve(false);
9826 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9827
9830 editHTML1.setHsHTML(HS1);
9831 Rectangle2D tailleEcran1 = Screen.getPrimary().getBounds();
9832 int iHauteur1 = (int) tailleEcran1.getHeight() - 100;
9833 int iLargeur1 = (int) tailleEcran1.getWidth() - 100;
9834 editHTML1.affiche(iLargeur1, iHauteur1);
9835 editHTML1.addPropertyChangeListener("bValide", (ev) -> {
9836 if (ev.getNewValue().toString().equals("true")) {
9839 dejaCharge = false;
9841 affHS1.setId("labels");
9842 vbVisuHotspots.getChildren().add(affHS1);
9843 apVisuHS.setPrefHeight(affHS1.getPrefHeight());
9844 }
9845 });
9846 } else {
9847 bDragDrop = false;
9848 }
9849 mouseEvent1.consume();
9850 }
9851 valideHS();
9852 mouseEvent1.consume();
9853 });
9854
9855 }
9856 }
9857
9863 private static void panoAjouteDiaporama(double X, double Y) {
9864 if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
9865 valideHS();
9866 setbDejaSauve(false);
9867 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9868 double mouseX = X;
9869 double mouseY = Y; // Y est déjà en coordonnées locales du panePanoramique
9870 double longitude, latitude;
9871 double largeur = ivImagePanoramique.getFitWidth();
9872 double hauteur = ivImagePanoramique.getFitHeight();
9873 longitude = 360.0f * mouseX / largeur - 180;
9874 latitude = 90.0d - (mouseY / hauteur) * 180.0f;
9875 Circle circPoint = new Circle(mouseX + ivImagePanoramique.getLayoutX(), mouseY, 5);
9876 circPoint.setFill(Color.TURQUOISE);
9877 circPoint.setStroke(Color.ORANGE);
9878 circPoint.setId("dia" + getiNumDiapo());
9879 circPoint.setCursor(Cursor.DEFAULT);
9880 panePanoramique.getChildren().add(circPoint);
9881 Tooltip tltpImage = new Tooltip("Diaporama n° " + (getiNumDiapo() + 1));
9882 tltpImage.setStyle(getStrTooltipStyle());
9883 Tooltip.install(circPoint, tltpImage);
9885 HS.setLongitude(longitude);
9886 HS.setLatitude(latitude);
9888 for (int i = 0; i < getiNombreDiapo(); i++) {
9889 choixDiapo.add(diaporamas[i].getStrNomDiaporama());
9890 }
9891 ChoiceDialog<String> dialog = new ChoiceDialog<>(diaporamas[0].getStrNomDiaporama(), choixDiapo);
9892 dialog.setTitle(rbLocalisation.getString("main.choixDiapo"));
9893 dialog.setHeaderText(null);
9894 dialog.setContentText(rbLocalisation.getString("main.diapos"));
9895
9896 Optional<String> result = dialog.showAndWait();
9897 if (result.isPresent()) {
9898 boolean bTrouve = false;
9899 int iTrouve = -1;
9900 for (int i = 0; i < getiNombreDiapo(); i++) {
9901 if (diaporamas[i].getStrNomDiaporama().equals(result.get())) {
9902 bTrouve = true;
9903 iTrouve = i;
9904 }
9905 }
9906 if (bTrouve) {
9907 HS.setiNumDiapo(iTrouve);
9911 valideHS();
9912 dejaCharge = false;
9914 affHS1.setId("labels");
9915 vbVisuHotspots.getChildren().add(affHS1);
9916
9917 spPanneauOutils.setVvalue(spPanneauOutils.getVvalue() + 145);
9918
9919 }
9920 }
9921 circPoint.setOnDragDetected((mouseEvent1) -> {
9922 circPoint.setFill(Color.ORANGE);
9923 circPoint.setStroke(Color.TURQUOISE);
9924 bDragDrop = true;
9925 mouseEvent1.consume();
9926
9927 });
9928 circPoint.setOnMouseDragged((mouseEvent1) -> {
9929 double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
9930 if (XX < 0) {
9931 XX = 0;
9932 }
9933 if (XX > ivImagePanoramique.getFitWidth()) {
9934 XX = ivImagePanoramique.getFitWidth();
9935 }
9936 circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
9937 double YY = mouseEvent1.getY();
9938 if (YY < 0) {
9939 YY = 0;
9940 }
9941 if (YY > ivImagePanoramique.getFitHeight()) {
9942 YY = ivImagePanoramique.getFitHeight();
9943 }
9944 circPoint.setCenterY(YY);
9945 afficheLoupe(XX, YY);
9946 mouseEvent1.consume();
9947 });
9948 circPoint.setOnMouseReleased((mouseEvent1) -> {
9949 setbDejaSauve(false);
9950 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9951 String strPoint = circPoint.getId();
9952 strPoint = strPoint.substring(3, strPoint.length());
9953 int iNumeroPoint = Integer.parseInt(strPoint);
9954 double X1 = mouseEvent1.getSceneX();
9955 double Y1 = mouseEvent1.getY(); // Coordonnées locales du panePanoramique
9956 double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
9957 if (mouseX1 < 0) {
9958 mouseX1 = 0;
9959 }
9960 if (mouseX1 > ivImagePanoramique.getFitWidth()) {
9961 mouseX1 = ivImagePanoramique.getFitWidth();
9962 }
9963
9964 double mouseY1 = Y1; // Y déjà en coordonnées locales
9965 if (mouseY1 < 0) {
9966 mouseY1 = 0;
9967 }
9968 if (mouseY1 > ivImagePanoramique.getFitHeight()) {
9969 mouseY1 = ivImagePanoramique.getFitHeight();
9970 }
9971
9972 double longit, lat;
9973 double larg = ivImagePanoramique.getFitWidth();
9974 longit = 360.0f * mouseX1 / larg - 180;
9975 lat = 90.0d - (mouseY1 / ivImagePanoramique.getFitHeight()) * 180.0f;
9978 circPoint.setFill(Color.TURQUOISE);
9979 circPoint.setStroke(Color.ORANGE);
9980 mouseEvent1.consume();
9981
9982 });
9983
9984 circPoint.setOnMouseClicked((mouseEvent1) -> {
9985 String strPoint = circPoint.getId();
9986 strPoint = strPoint.substring(3, strPoint.length());
9987 int iNum = Integer.parseInt(strPoint);
9988 if (mouseEvent1.isControlDown()) {
9989 setbDejaSauve(false);
9990 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
9992 nodeImage = (Node) panePanoramique.lookup("#dia" + strPoint);
9993 panePanoramique.getChildren().remove(nodeImage);
9994
9995 for (int io = iNum + 1; io < getiNumDiapo(); io++) {
9996 nodeImage = (Node) panePanoramique.lookup("#dia" + Integer.toString(io));
9997 nodeImage.setId("dia" + Integer.toString(io - 1));
9998 Tooltip tltpImage1 = new Tooltip("Diaporama n° " + io);
9999 tltpImage1.setStyle(getStrTooltipStyle());
10000 Tooltip.install(nodeImage, tltpImage1);
10001
10002 }
10013 } else {
10014 if (!bDragDrop) {
10015 setbDejaSauve(false);
10016 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
10018 for (int i = 0; i < getiNombreDiapo(); i++) {
10019 choixDiapo1.add(diaporamas[i].getStrNomDiaporama());
10020 }
10022 dialog1.setTitle(rbLocalisation.getString("main.choixDiapo"));
10023 dialog1.setHeaderText(null);
10024 dialog1.setContentText(rbLocalisation.getString("main.diapos"));
10025
10026 Optional<String> result1 = dialog1.showAndWait();
10027 if (result1.isPresent()) {
10028 boolean bTrouve = false;
10029 int iTrouve = -1;
10030 for (int i = 0; i < getiNombreDiapo(); i++) {
10031 if (diaporamas[i].getStrNomDiaporama().equals(result1.get())) {
10032 bTrouve = true;
10033 iTrouve = i;
10034 }
10035 }
10036 if (bTrouve) {
10039 valideHS();
10041 }
10042 }
10043
10044 } else {
10045 bDragDrop = false;
10046 }
10047 mouseEvent1.consume();
10048 }
10049 valideHS();
10050 mouseEvent1.consume();
10051 });
10052
10053 }
10054 }
10055
10061 if (mouseEvent.getButton() == MouseButton.SECONDARY) {
10062 if (mouseEvent.isShiftDown()) {
10063 panoChoixNord(mouseEvent.getSceneX() - ivImagePanoramique.getLayoutX());
10064 mouseEvent.consume();
10065 } else if (mouseEvent.isControlDown()) {
10066 } else {
10067 panoChoixRegard(mouseEvent.getSceneX() - ivImagePanoramique.getLayoutX(), mouseEvent.getY());
10068 mouseEvent.consume();
10069 }
10070 }
10071 if (mouseEvent.getButton() == MouseButton.PRIMARY) {
10072 if (!(mouseEvent.isControlDown()) && bEstCharge) {
10073 if (!bDragDrop) {
10074 panePanoramique.setCursor(Cursor.DEFAULT);
10075 panePanoramique.setOnMouseClicked(
10076 (me) -> {
10077 }
10078 );
10079 Circle c1 = new Circle(mouseEvent.getSceneX(), mouseEvent.getSceneY() - panePanoramique.getLayoutY() - 130 - getiDecalageMac(), 3);
10080 panePanoramique.getChildren().add(c1);
10082
10083 // Ajout des items
10084 if (getiNombrePanoramiques() > 1) {
10085 lvMenuChoixTypeHotspot.getItems().add("Panoramique");
10086 }
10087 lvMenuChoixTypeHotspot.getItems().add("Image");
10088 if (getiNombreDiapo() > 0) {
10089 lvMenuChoixTypeHotspot.getItems().add("Diaporama");
10090 }
10091 lvMenuChoixTypeHotspot.getItems().add("HTML");
10092 lvMenuChoixTypeHotspot.getItems().add("Annuler");
10093
10094 // Taille adaptative basée sur le nombre d'items et la hauteur des cellules
10095 int nbItems = lvMenuChoixTypeHotspot.getItems().size();
10096 double cellHeight = 36; // Hauteur d'une cellule avec les nouveaux CSS (augmentée)
10097 double padding = 10; // Padding vertical (augmenté)
10099
10102 lvMenuChoixTypeHotspot.setMinWidth(150); // Largeur minimale augmentée pour le contenu
10103 lvMenuChoixTypeHotspot.setPrefWidth(150);
10104 lvMenuChoixTypeHotspot.setCursor(Cursor.DEFAULT);
10105 lvMenuChoixTypeHotspot.setLayoutX(mouseEvent.getSceneX());
10106 lvMenuChoixTypeHotspot.setLayoutY(mouseEvent.getSceneY() - panePanoramique.getLayoutY() - 104 - getiDecalageMac());
10107 panePanoramique.getChildren().add(lvMenuChoixTypeHotspot);
10108 lvMenuChoixTypeHotspot.getSelectionModel().selectedItemProperty().addListener((ov, ancValeur, nouvValeur) -> {
10109 panePanoramique.getChildren().remove(lvMenuChoixTypeHotspot);
10110 panePanoramique.getChildren().remove(c1);
10111
10112 switch (nouvValeur) {
10113 case "Panoramique":
10114 panoMouseClic(mouseEvent.getSceneX() - ivImagePanoramique.getLayoutX(), mouseEvent.getY());
10115 break;
10116 case "Image":
10117 panoAjouteImage(mouseEvent.getSceneX() - ivImagePanoramique.getLayoutX(), mouseEvent.getY());
10118 break;
10119 case "HTML":
10120 panoAjouteHTML(mouseEvent.getSceneX() - ivImagePanoramique.getLayoutX(), mouseEvent.getY());
10121 break;
10122 case "Diaporama":
10123 panoAjouteDiaporama(mouseEvent.getSceneX() - ivImagePanoramique.getLayoutX(), mouseEvent.getY());
10124 break;
10125 case "Annuler":
10126 break;
10127
10128 }
10129 panePanoramique.setCursor(Cursor.CROSSHAIR);
10130 panePanoramique.setOnMouseClicked(
10131 (me) -> {
10133 }
10134 );
10135
10136 }
10137 );
10138
10139 } else {
10140 bDragDrop = false;
10141 }
10142 }
10143 }
10144 }
10145
10146 private static void afficheLoupe(double x, double y) {
10147 positLoupeX = x;
10148 positLoupeY = y;
10149 if (x < getiTailleLoupe() + 50 && y < getiTailleLoupe() + 50 && strPositLoupe.equals("gauche")) {
10150 apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
10151 strPositLoupe = "droite";
10152 }
10153 if (x > ivImagePanoramique.getFitWidth() - getiTailleLoupe() - 35 && y < getiTailleLoupe() + 50 && strPositLoupe.equals("droite")) {
10154 apLoupe.setLayoutX(35);
10155 strPositLoupe = "gauche";
10156 }
10157 double facteur = 8000 / ivImagePanoramique.getFitWidth();
10158 double xx1 = (x * facteur);
10159 double yy1 = (y * facteur);
10160 ivLoupe.setClip(new Circle(xx1, yy1, getiTailleLoupe() / 2));
10161 ivLoupe.setLayoutX(-xx1 + getiTailleLoupe() / 2 + 10);
10162 ivLoupe.setLayoutY(-yy1 + getiTailleLoupe() / 2 + 10);
10163 }
10164
10168 private static void installeEvenements() {
10173 if ((double) newSceneWidth < 1280) {
10174 }
10175 double largeur = (double) newSceneWidth - largeurOutils - 20;
10176 apPanovisu.setLayoutX((double) newSceneWidth - largeurOutils);
10177 spVuePanoramique.setPrefWidth(largeur);
10178 spVuePanoramique.setBackground(new Background(new BackgroundFill(Color.BLUE, CornerRadii.EMPTY, Insets.EMPTY)));
10179 gestionnaireInterface.getApVis().setPrefWidth((double) newSceneWidth - largeurOutils - 20);
10180 if ((double) newSceneWidth - largeurOutils - 20 < gestionnaireInterface.getApVis().getMaxWidth()) {
10181 gestionnaireInterface.getApVis().setMinWidth((double) newSceneWidth - largeurOutils - 20);
10182 }
10183 if ((double) newSceneWidth - largeurOutils - 20 < gestionnairePlan.getApPlan().getMaxWidth()) {
10184 gestionnairePlan.getApPlan().setMinWidth((double) newSceneWidth - largeurOutils - 20);
10185 }
10186 gestionnairePlan.getApPlan().setPrefWidth((double) newSceneWidth - largeurOutils - 20);
10187
10188 });
10193 spVuePanoramique.setPrefHeight((double) newSceneHeight - 130.0d - getiDecalageMac());
10194 spPanneauOutils.setPrefHeight((double) newSceneHeight - 130.0d - getiDecalageMac());
10195
10196 spVuePanoramique.setBackground(new Background(new BackgroundFill(Color.BLUE, CornerRadii.EMPTY, Insets.EMPTY)));
10197 if ((double) newSceneHeight - 130.0d - getiDecalageMac() < gestionnaireInterface.getSpOutils().getMaxHeight()) {
10198 gestionnaireInterface.getSpOutils().setMinHeight((double) newSceneHeight - 130.0d - getiDecalageMac());
10199 }
10200
10201 gestionnaireInterface.getSpOutils().setPrefHeight((double) newSceneHeight - 130.0d - getiDecalageMac());
10202 gestionnairePlan.getSpOutils().setPrefHeight((double) newSceneHeight - 130 - getiDecalageMac());
10203
10204 if ((double) newSceneHeight - 130 - getiDecalageMac() < gestionnairePlan.getSpOutils().getMaxHeight()) {
10205 gestionnairePlan.getSpOutils().setMinHeight((double) newSceneHeight - 130 - getiDecalageMac());
10206 }
10207 });
10208
10209 getScnPrincipale().setOnKeyPressed((clavierEvt) -> {
10210 //System.out.println("Code clavier : " + clavierEvt.getCode());
10211 if (clavierEvt.isControlDown()) {
10212 if (clavierEvt.getText().toLowerCase().equals("l")) {
10213 clavierEvt.consume();
10214 setAfficheLoupe(!isAfficheLoupe());
10215 apLoupe.setVisible(isAfficheLoupe());
10216 Point p = MouseInfo.getPointerInfo().getLocation();
10217 if (p.x < getiTailleLoupe() + 80 && p.y < getiTailleLoupe() + 160) {
10218 apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
10219 apLoupe.setLayoutY(35);
10220 strPositLoupe = "droite";
10221 } else {
10222 apLoupe.setLayoutX(35);
10223 apLoupe.setLayoutY(35);
10224 strPositLoupe = "gauche";
10225 }
10226 }
10227 }
10228 if (clavierEvt.getText().equals("+")) {
10229 setiTailleLoupe(getiTailleLoupe() + 10);
10230 creeLoupe();
10231 afficheLoupe(positLoupeX, positLoupeY);
10232 }
10233 if (clavierEvt.getText().equals("-")) {
10234 setiTailleLoupe(getiTailleLoupe() - 10);
10235 creeLoupe();
10236 afficheLoupe(positLoupeX, positLoupeY);
10237 }
10238 });
10239
10243 panePanoramique.setOnMouseClicked(
10244 (mouseEvent) -> {
10246 }
10247 );
10251 panePanoramique.setOnMouseMoved(
10252 (mouseEvent) -> {
10253 if (bEstCharge) {
10254 double mouseX = mouseEvent.getSceneX() - ivImagePanoramique.getLayoutX();
10255 if (mouseX < 0) {
10256 mouseX = 0;
10257 }
10258 if (mouseX > ivImagePanoramique.getFitWidth()) {
10259 mouseX = ivImagePanoramique.getFitWidth();
10260 }
10261 // Test: essayons sans aucun offset pour voir la valeur brute
10262 double mouseYBrut = mouseEvent.getY();
10263 // Calcul avec les offsets
10264 double mouseY = mouseYBrut;
10265 if (mouseY < 0) {
10266 mouseY = 0;
10267 }
10268 if (mouseY > ivImagePanoramique.getFitHeight()) {
10269 mouseY = ivImagePanoramique.getFitHeight();
10270 }
10271
10272 double longitude, latitude;
10273 double largeur = ivImagePanoramique.getFitWidth();
10274 double hauteur = ivImagePanoramique.getFitHeight();
10275 longitude = 360.0f * mouseX / largeur - 180;
10276 latitude = 90.0d - (mouseY / hauteur) * 180.0f;
10277 String strLong = "Long : " + String.format("%.1f", longitude);
10278 String strLat = "Lat : " + String.format("%.1f", latitude);
10279 lblLong.setText(strLong);
10280 lblLat.setText(strLat);
10282 }
10283 }
10284 );
10285 cbListeChoixPanoramique.valueProperty()
10286 .addListener((ov, ancienneValeur, nouvelleValeur) -> {
10287 if (nouvelleValeur != null) {
10288 if (!(nouvelleValeur.equals(strPanoAffiche))) {
10289 valideHS();
10290 strPanoAffiche = nouvelleValeur.toString();
10291 }
10292 }
10293 });
10294
10295 }
10296
10300 private static void ajouteAffichageLignes() {
10301 double largeur = ivImagePanoramique.getFitWidth();
10302 double hauteur = largeur / 2.0d;
10304 int iX, iY;
10305 int iNl = 0;
10306 for (int i = -180; i < 180; i += 10) {
10307 iX = (int) (largeur / 2.0f + largeur / 360.0f * (float) i + ivImagePanoramique.getLayoutX());
10308 lineCoordonnees = new Line(iX, 0, iX, hauteur);
10309 lineCoordonnees.setId("ligne" + iNl);
10310 iNl++;
10311 lineCoordonnees.setStroke(Color.ORANGE);
10312 if (i == 0) {
10313 lineCoordonnees.setStroke(Color.WHITE);
10314 lineCoordonnees.setStrokeWidth(0.5);
10315 } else {
10316 if ((i % 20) == 0) {
10317 lineCoordonnees.setStroke(Color.WHITE);
10318 lineCoordonnees.setStrokeWidth(0.25);
10319 } else {
10320 lineCoordonnees.setStroke(Color.GRAY);
10321 lineCoordonnees.setStrokeWidth(0.25);
10322 }
10323 }
10324 panePanoramique.getChildren().add(lineCoordonnees);
10325 }
10326 for (int i = -90; i < 90; i += 10) {
10327 iY = (int) (hauteur / 2.0f + hauteur / 180.0f * (float) i);
10328 lineCoordonnees = new Line(ivImagePanoramique.getLayoutX(), iY, largeur + ivImagePanoramique.getLayoutX(), iY);
10329 lineCoordonnees.setId("ligne" + iNl);
10330 iNl++;
10331 if (i == 0) {
10332 lineCoordonnees.setStroke(Color.WHITE);
10333 lineCoordonnees.setStrokeWidth(0.5);
10334 } else {
10335 if ((i % 20) == 0) {
10336 lineCoordonnees.setStroke(Color.WHITE);
10337 lineCoordonnees.setStrokeWidth(0.25);
10338 } else {
10339 lineCoordonnees.setStroke(Color.GRAY);
10340 lineCoordonnees.setStrokeWidth(0.25);
10341 }
10342 }
10343
10344 panePanoramique.getChildren().add(lineCoordonnees);
10345 }
10346
10347 }
10348
10352 private static void retireAffichageLigne() {
10353 int i = 0;
10355 do {
10356 nodeLigne = (Node) panePanoramique.lookup("#ligne" + i);
10357 if (nodeLigne != null) {
10358 panePanoramique.getChildren().remove(nodeLigne);
10359 }
10360 i++;
10361 } while (nodeLigne != null);
10362 }
10363
10367 private static void creeLoupe() {
10368 apLoupe.getChildren().clear();
10369 if (strPositLoupe.equals("gauche")) {
10370 apLoupe.setLayoutX(35);
10371 }
10372 if (strPositLoupe.equals("droite")) {
10373 apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
10374 }
10375 apLoupe.setLayoutY(35);
10376
10377 Line lig1 = new Line(getiTailleLoupe() / 2 + 10, 10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() + 10);
10378 lig1.setStroke(Color.GOLD);
10379 Line lig2 = new Line(10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() + 10, getiTailleLoupe() / 2 + 10);
10380 lig2.setStroke(Color.GOLD);
10381 Circle circ1 = new Circle(getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 6);
10382 circ1.setStroke(Color.GOLDENROD);
10383 circ1.setFill(Color.GOLDENROD);
10384 Circle circ2 = new Circle(getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 5);
10385 circ2.setStroke(Color.GOLD);
10386 circ2.setFill(Color.GOLD);
10387 Circle circ3 = new Circle(getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 2);
10388 circ3.setStroke(Color.GOLDENROD);
10389 circ3.setFill(Color.GOLDENROD);
10390 Circle circ4 = new Circle(getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2);
10391 circ4.setStroke(Color.BLACK);
10392 circ4.setFill(Color.BLACK);
10393 apLoupe.getChildren().addAll(circ1, circ2, circ3, circ4, ivLoupe, lig1, lig2);
10394 apLoupe.setOnMouseMoved((me) -> {
10395 if (strPositLoupe.equals("gauche")) {
10396 apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
10397 strPositLoupe = "droite";
10398 }
10399 if (strPositLoupe.equals("droite")) {
10400 apLoupe.setLayoutX(35);
10401 strPositLoupe = "gauche";
10402 }
10403 });
10404 apLoupe.setOnMouseEntered((me) -> {
10405 if (strPositLoupe.equals("gauche")) {
10406 apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
10407 strPositLoupe = "droite";
10408 }
10409 if (strPositLoupe.equals("droite")) {
10410 apLoupe.setLayoutX(35);
10411 strPositLoupe = "gauche";
10412 }
10413 });
10414 }
10415
10421 @SuppressWarnings("empty-statement")
10422 public static void affichePanoChoisit(int iNumPanochoisi) {
10423 ivImagePanoramique.setImage(getPanoramiquesProjet()[iNumPanochoisi].getImgPanoramique());
10424 Node nodeLegende = (Node) apPanneauPrincipal.lookup("#legende");
10425 nodeLegende.setVisible(true);
10426 retireAffichagePointsHotSpots();
10427 retireAffichageHotSpots();
10428 retireAffichageLigne();
10429 setiPanoActuel(iNumPanochoisi);
10430
10431 if (getPanoramiquesProjet()[iNumPanochoisi].getStrTypePanoramique().equals(Panoramique.CUBE)) {
10432 ivLoupe.setImage(getPanoramiquesProjet()[iNumPanochoisi].getImgCubeEqui());
10433 } else {
10434 String strFicImage = getStrRepertPanos() + File.separator + "panovisu" + iNumPanochoisi + ".jpg";
10435 ivLoupe.setImage(new Image("file:" + strFicImage));
10436 ivLoupe.setSmooth(true);
10437 ivLoupe.setPreserveRatio(true);
10438 ivLoupe.setFitWidth(8000);
10439 }
10440 ivLoupe.setClip(new Circle(4000, 2000, getiTailleLoupe() / 2));
10441 ivLoupe.setLayoutX(-4000 + getiTailleLoupe() / 2 + 10);
10442 ivLoupe.setLayoutY(-2000 + getiTailleLoupe() / 2 + 10);
10443 apLoupe.setPrefSize(getiTailleLoupe() + 20, getiTailleLoupe() + 20);
10444 apLoupe.setMinSize(getiTailleLoupe() + 20, getiTailleLoupe() + 20);
10445 apLoupe.setMaxSize(getiTailleLoupe() + 20, getiTailleLoupe() + 20);
10446 //apLoupe.setStyle("-fx-border-width : 2px;-fx-background-color : blue;-fx-border-color :darkblue;");
10447 creeLoupe();
10448 panePanoramique.setOnMouseEntered((me) -> {
10449 if (isAfficheLoupe()) {
10450 apLoupe.setVisible(true);
10451 }
10452 });
10453 panePanoramique.setOnMouseExited((me) -> {
10454 apLoupe.setVisible(false);
10455 });
10456 setiNumPoints(0);
10457 if (navigateurPanoramique == null) {
10458 Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
10459 int iHauteur;
10460 if (isMac()) {
10461 iHauteur = (int) tailleEcran.getHeight() - 230;
10462 } else {
10463 iHauteur = (int) tailleEcran.getHeight() - 170;
10464 }
10465 int iLargeur = (int) tailleEcran.getWidth() - 20;
10466 apVisuPanoramique.getChildren().clear();
10467
10468 // Images pour le bouton plein écran adaptées au thème
10470 String suffixeIcone = estThemeSombre ? "_bl.png" : ".png";
10471 Image imgExpand = new Image("file:" + getStrRepertAppli() + "/images/expand" + suffixeIcone, 30, 30, false, true);
10472 Image imgShrink = new Image("file:" + getStrRepertAppli() + "/images/shrink" + suffixeIcone, 30, 30, false, true);
10473
10474 navigateurPanoramique
10475 = new NavigateurPanoramique(getPanoramiquesProjet()[iNumPanochoisi].getImgVisuPanoramique(), 10.d, 10.d, 340, 170);
10476 // Utiliser le cache pour le petit visualiseur
10477 apVisuPano = navigateurPanoramique.affichePano(getPanoramiquesProjet()[iNumPanochoisi]);
10478
10479 // Configuration du bouton plein écran via PropertyChangeListener
10480 Button btnPleinEcran = navigateurPanoramique.getBtnPleinEcran();
10482 if (btnPleinEcran != null && btnPleinEcran.getGraphic() instanceof ImageView) {
10483 ivBtnPleinEcranFinal = (ImageView) btnPleinEcran.getGraphic();
10485 } else {
10486 ivBtnPleinEcranFinal = null;
10487 }
10488
10489 navigateurPanoramique.addPropertyChangeListener("pleinEcran", (e) -> {
10490 boolean pleinEcran = (boolean) e.getNewValue();
10491 if (pleinEcran) {
10492 // Ouvrir une fenêtre popup de taille intermédiaire (solution médiane)
10493 bPleinEcranPanoramique = true;
10494
10495 // Trouver l'index du panorama actuellement affiché dans le petit visualiseur
10496 String nomFichierVisu = navigateurPanoramique.getNomFichierPanoramique();
10497 int indexPanoVisu = -1;
10498 for (int i = 0; i < getPanoramiquesProjet().length; i++) {
10499 if (getPanoramiquesProjet()[i] != null &&
10500 getPanoramiquesProjet()[i].getStrNomFichier() != null &&
10501 getPanoramiquesProjet()[i].getStrNomFichier().equals(nomFichierVisu)) {
10502 indexPanoVisu = i;
10503 break;
10504 }
10505 }
10506
10507 // Si on n'a pas trouvé, utiliser getiPanoActuel() par défaut
10508 if (indexPanoVisu == -1) {
10509 indexPanoVisu = getiPanoActuel();
10510 }
10511
10512 System.out.println("🔍 DEBUG: Passage en plein écran");
10513 System.out.println(" Fichier petit visu: " + nomFichierVisu);
10514 System.out.println(" Index trouvé: " + indexPanoVisu);
10515 System.out.println(" getiPanoActuel() = " + getiPanoActuel());
10516
10517 // Créer une nouvelle fenêtre popup
10518 Stage stageVisuPano = new Stage();
10519 stageVisuPano.setTitle("Visualisation Panoramique - " + getPanoramiquesProjet()[indexPanoVisu].getStrNomFichier());
10520 stageVisuPano.initModality(Modality.APPLICATION_MODAL);
10521 stageVisuPano.initOwner(stPrincipal);
10522
10523 // Taille intermédiaire : 1200x780 (bonne qualité sans pixellisation excessive)
10524 int largeurPopup = 1200;
10525 int hauteurPopup = 780;
10526
10527 // Utiliser l'image haute résolution pré-chargée si disponible
10528 Image imgHauteRes = getPanoramiquesProjet()[indexPanoVisu].getImgHauteResolution();
10529
10530 if (imgHauteRes != null) {
10531 System.out.println("📸 Utilisation de l'image haute résolution pré-chargée");
10532 System.out.println(" ⚡ Cache: " + (int)imgHauteRes.getWidth() + "×" + (int)imgHauteRes.getHeight());
10533 } else {
10534 // Fallback : charger à la volée si le cache n'existe pas
10535 System.out.println("📸 Cache HR non disponible, chargement à la volée...");
10536 String fichierPano = getPanoramiquesProjet()[indexPanoVisu].getStrNomFichier();
10538
10539 if (filePano.exists()) {
10540 Image imgOrigine = new Image("file:" + fichierPano);
10541 imgHauteRes = imgTransformationImage(imgOrigine, 1);
10542 }
10543 }
10544
10545 // Utiliser l'image haute résolution si disponible, sinon utiliser l'image normale
10546 Image imgAUtiliser = (imgHauteRes != null) ? imgHauteRes : getPanoramiquesProjet()[indexPanoVisu].getImgVisuPanoramique();
10547
10548 // Créer un nouveau navigateur avec positionnement correct
10549 // positX=10, positY=10 pour laisser de l'espace pour les labels et boutons
10550 // hauteur réduite de 100px pour les contrôles (labels en haut + boutons en bas + marge)
10552 imgAUtiliser,
10553 10.0, // positX
10554 10.0, // positY
10555 largeurPopup - 20, // largeur avec marges
10556 hauteurPopup - 100 // hauteur moins espace pour contrôles
10557 );
10558
10559 // Activer le mode haute qualité AVANT affichePano()
10560 System.out.println("🎨 Activation du mode haute qualité...");
10561 System.out.println(" Équirectangulaire: 3000x1500");
10562 System.out.println(" Faces du cube: 1000x1000");
10563 navigPopup.setHauteQualite(true);
10564
10565 // Copier l'état de visualisation actuel
10566 navigPopup.setLongitude(navigateurPanoramique.getLongitude());
10567 navigPopup.setLatitude(navigateurPanoramique.getLatitude());
10568 navigPopup.setFov(navigateurPanoramique.getFov());
10569
10570 // Afficher le panorama avec cache des cubes pré-calculés
10571 AnchorPane apPopup = navigPopup.affichePano(getPanoramiquesProjet()[indexPanoVisu]);
10572
10573 // Masquer le bouton plein écran APRÈS affichePano() (inutile dans la popup)
10574 if (navigPopup.getBtnPleinEcran() != null) {
10575 navigPopup.getBtnPleinEcran().setVisible(false);
10576 navigPopup.getBtnPleinEcran().setManaged(false);
10577 }
10578
10580 stageVisuPano.setScene(scenePopup);
10581 stageVisuPano.centerOnScreen();
10582
10583 // Quand on ferme la popup, remettre le bouton à l'état normal
10584 stageVisuPano.setOnHidden(event -> {
10585 if (ivBtnPleinEcranFinal != null) {
10587 }
10588 // Réinitialiser l'état du bouton dans le navigateur
10589 navigateurPanoramique.setbPleinEcran(false);
10590 bPleinEcranPanoramique = false;
10591 });
10592
10593 stageVisuPano.show();
10594 if (ivBtnPleinEcranFinal != null) {
10596 }
10597
10598 } else {
10599 // Remettre l'icône à l'état normal (la fermeture est gérée par la popup)
10600 if (ivBtnPleinEcranFinal != null) {
10602 }
10603 bPleinEcranPanoramique = false;
10604 }
10605 });
10606
10607 navigateurPanoramique.addPropertyChangeListener("positNord", (e) -> {
10608 double longitude = Math.round(Double.parseDouble(e.getNewValue().toString()) * 10) / 10.d - 180;
10609 longitude = longitude % 360;
10610 longitude = longitude < 0 ? longitude + 360 : longitude;
10611 longitude = longitude > 180 ? longitude - 360 : longitude;
10612 getPanoramiquesProjet()[getiPanoActuel()].setZeroNord(longitude);
10613 afficheNord(longitude);
10614 });
10615 navigateurPanoramique.addPropertyChangeListener("choixLatitude", (e) -> {
10616 double latitude = Math.round(navigateurPanoramique.getChoixLatitude() * 10) / 10.d;
10617 double longitude = Math.round(navigateurPanoramique.getChoixLongitude() * 10) / 10.d - 180;
10618 double fov = Math.round(navigateurPanoramique.getChoixFov() * 10) / 10.d;
10619 longitude = longitude % 360;
10620 longitude = longitude < 0 ? longitude + 360 : longitude;
10621 longitude = longitude > 180 ? longitude - 360 : longitude;
10622
10623 getPanoramiquesProjet()[getiPanoActuel()].setRegardX(longitude);
10624 getPanoramiquesProjet()[getiPanoActuel()].setRegardY(latitude);
10625 getPanoramiquesProjet()[getiPanoActuel()].setChampVisuel(fov);
10626 affichePoV(longitude, latitude, fov);
10627 });
10628 navigateurPanoramique.addPropertyChangeListener("choixLongitude", (e) -> {
10629 double latitude = Math.round(navigateurPanoramique.getChoixLatitude() * 10) / 10.d;
10630 double longitude = Math.round(navigateurPanoramique.getChoixLongitude() * 10) / 10.d - 180;
10631 double fov = Math.round(navigateurPanoramique.getChoixFov() * 10) / 10.d;
10632 longitude = longitude % 360;
10633 longitude = longitude < 0 ? longitude + 360 : longitude;
10634 longitude = longitude > 180 ? longitude - 360 : longitude;
10635 getPanoramiquesProjet()[getiPanoActuel()].setRegardX(longitude);
10636 getPanoramiquesProjet()[getiPanoActuel()].setRegardY(latitude);
10637 getPanoramiquesProjet()[getiPanoActuel()].setChampVisuel(fov);
10638 affichePoV(longitude, latitude, fov);
10639 });
10640 navigateurPanoramique.addPropertyChangeListener("choixFov", (e) -> {
10641 double latitude = Math.round(navigateurPanoramique.getChoixLatitude() * 10) / 10.d;
10642 double longitude = Math.round(navigateurPanoramique.getChoixLongitude() * 10) / 10.d - 180;
10643 double fov = Math.round(navigateurPanoramique.getChoixFov() * 10) / 10.d;
10644 longitude = longitude % 360;
10645 longitude = longitude < 0 ? longitude + 360 : longitude;
10646 longitude = longitude > 180 ? longitude - 360 : longitude;
10647 getPanoramiquesProjet()[getiPanoActuel()].setRegardX(longitude);
10648 getPanoramiquesProjet()[getiPanoActuel()].setRegardY(latitude);
10649 getPanoramiquesProjet()[getiPanoActuel()].setChampVisuel(fov);
10650 affichePoV(longitude, latitude, fov);
10651 });
10652 navigateurPanoramique.setPositNord(getPanoramiquesProjet()[iNumPanochoisi].getZeroNord() - 180);
10653 navigateurPanoramique.setLongitude(getPanoramiquesProjet()[iNumPanochoisi].getRegardX() - 180);
10654 navigateurPanoramique.setLatitude(getPanoramiquesProjet()[iNumPanochoisi].getRegardY());
10655 navigateurPanoramique.setFov(getPanoramiquesProjet()[iNumPanochoisi].getChampVisuel());
10656 navigateurPanoramique.setChoixLatitude(navigateurPanoramique.getLatitude());
10657 navigateurPanoramique.setChoixLongitude(navigateurPanoramique.getLongitude());
10658 navigateurPanoramique.setChoixFov(navigateurPanoramique.getFov());
10659 apVisuPanoramique.getChildren().addAll(apVisuPano);
10660 navigateurPanoramique.affiche();
10661 } else {
10662 // Utiliser la version optimisée avec cache des cubes pré-calculés
10663 navigateurPanoramique.setImagePanoramique(
10664 getPanoramiquesProjet()[iNumPanochoisi].getStrNomFichier(),
10665 getPanoramiquesProjet()[iNumPanochoisi].getImgVisuPanoramique(),
10666 getPanoramiquesProjet()[iNumPanochoisi]
10667 );
10668 navigateurPanoramique.setPositNord(getPanoramiquesProjet()[iNumPanochoisi].getZeroNord() - 180);
10669 navigateurPanoramique.setLongitude(getPanoramiquesProjet()[iNumPanochoisi].getRegardX() - 180);
10670 navigateurPanoramique.setLatitude(getPanoramiquesProjet()[iNumPanochoisi].getRegardY());
10671 navigateurPanoramique.setFov(getPanoramiquesProjet()[iNumPanochoisi].getChampVisuel());
10672 navigateurPanoramique.affiche();
10673 }
10674 if (getPanoramiquesProjet()[iNumPanochoisi].getMarqueurGeolocatisation() != null) {
10675 tfLatitude.setText(CoordonneesGeographiques.toDMS(getPanoramiquesProjet()[iNumPanochoisi].getMarqueurGeolocatisation().getLatitude()));
10676 tfLongitude.setText(CoordonneesGeographiques.toDMS(getPanoramiquesProjet()[iNumPanochoisi].getMarqueurGeolocatisation().getLongitude()));
10677 getPoGeolocalisation().setbValide(true);
10678 } else {
10679 if (isbInternet()) {
10680 tfLatitude.setText("");
10681 tfLongitude.setText("");
10682 getPoGeolocalisation().setbValide(false);
10683 }
10684
10685 }
10686 ajouteAffichagePointsHotspots();
10687 ajouteAffichagePointsHotspotsImage();
10688 ajouteAffichagePointsHotspotsHTML();
10689 ajouteAffichagePointsHotspotsDiapo();
10690
10691 ajouteAffichageHotspots();
10692 affichePoV(getPanoramiquesProjet()[iNumPanochoisi].getRegardX(), getPanoramiquesProjet()[iNumPanochoisi].getRegardY(), getPanoramiquesProjet()[iNumPanochoisi].getChampVisuel());
10693 afficheNord(getPanoramiquesProjet()[iNumPanochoisi].getZeroNord());
10694 ajouteAffichageLignes();
10695 afficheInfoPano();
10696 cbListeChoixPanoramique.setValue(cbListeChoixPanoramique.getItems().get(getiPanoActuel()));
10697 int iPano = -1;
10698 int ii = 0;
10699 for (String stNumPano : ordPano.getStrPanos()) {
10700 if (Integer.parseInt(stNumPano) == iNumPanochoisi) {
10701 iPano = ii;
10702 }
10703 ii++;
10704 }
10705 rectVignettePano.setLayoutY((iLargeurVignettes / 2 + 10) * iPano + 10);
10706 rectVignettePano.setVisible(true);
10707 cbMinLat.setSelected(getPanoramiquesProjet()[iNumPanochoisi].isbMinLat());
10708 cbMaxLat.setSelected(getPanoramiquesProjet()[iNumPanochoisi].isbMaxLat());
10709 if (cbMinLat.isSelected()) {
10710 slMinLat.setValue(getPanoramiquesProjet()[iNumPanochoisi].getMinLat());
10711 } else {
10712 slMinLat.setValue(-90);
10713 }
10714 if (cbMaxLat.isSelected()) {
10715 slMaxLat.setValue(getPanoramiquesProjet()[iNumPanochoisi].getMaxLat());
10716 } else {
10717 slMaxLat.setValue(90);
10718 }
10719 slMinFov.setValue(getPanoramiquesProjet()[iNumPanochoisi].getFovMin());
10720 slMaxFov.setValue(getPanoramiquesProjet()[iNumPanochoisi].getFovMax());
10721 navigateurPanoramique.setMaxFov(getPanoramiquesProjet()[iNumPanochoisi].getFovMax());
10722 navigateurPanoramique.setMinFov(getPanoramiquesProjet()[iNumPanochoisi].getFovMin());
10723 double largeurImage1 = panePanoramique.getPrefWidth();
10724 double X11 = ivImagePanoramique.getLayoutX();
10725 double Y1 = (90.0d - (double) slMinLat.getValue()) * largeurImage1 / 360.0d;
10726 ligNadir.setStartX(X11);
10727 ligNadir.setStartY(Y1);
10728 ligNadir.setEndX(X11 + largeurImage1);
10729 ligNadir.setEndY(Y1);
10730 Y1 = (90.0d - (double) (double) slMaxLat.getValue()) * largeurImage1 / 360.0d;
10731 ligZenith.setStartX(X11);
10732 ligZenith.setStartY(Y1);
10733 ligZenith.setEndX(X11 + largeurImage1);
10734 ligZenith.setEndY(Y1);
10735
10736 panePanoramique.getChildren().remove(ligNadir);
10737 panePanoramique.getChildren().remove(ligZenith);
10738 panePanoramique.getChildren().addAll(ligNadir, ligZenith);
10739 }
10740
10744 private static void afficheInfoPano() {
10745 TextField tfTitrePano = (TextField) getScnPrincipale().lookup("#txttitrepano");
10746 if (getPanoramiquesProjet()[getiPanoActuel()].getStrTitrePanoramique() != null) {
10747 tfTitrePano.setText(getPanoramiquesProjet()[getiPanoActuel()].getStrTitrePanoramique());
10748 } else {
10749 tfTitrePano.setText("");
10750 }
10751
10752 // Charge la description IA
10753 TextArea taDescriptionIA = (TextArea) getScnPrincipale().lookup("#txtDescriptionIA");
10754 if (taDescriptionIA != null) {
10755 if (getPanoramiquesProjet()[getiPanoActuel()].getStrDescriptionIA() != null) {
10756 taDescriptionIA.setText(getPanoramiquesProjet()[getiPanoActuel()].getStrDescriptionIA());
10757 } else {
10758 taDescriptionIA.setText("");
10759 }
10760 }
10761
10762 // Met à jour la checkbox "Afficher la description au chargement" et la validation du panel
10763 if (getGestionnaireInterface().getCbAfficheDescription() != null) {
10764 // Active le mode chargement pour éviter le déclenchement du listener
10765 getGestionnaireInterface().setbChargementEnCours(true);
10766
10767 boolean bAffDesc = getPanoramiquesProjet()[getiPanoActuel()].isAffDescription();
10768
10769 getGestionnaireInterface().getCbAfficheDescription().setSelected(bAffDesc);
10770 getGestionnaireInterface().setbAfficheDescription(bAffDesc);
10771
10772 // Met à jour la validation du panel pour qu'il devienne vert
10773 if (getGestionnaireInterface().getPoDescription() != null) {
10774 getGestionnaireInterface().getPoDescription().setbValide(bAffDesc);
10775 }
10776
10777 // Désactive le mode chargement
10778 getGestionnaireInterface().setbChargementEnCours(false);
10779 }
10780 }
10781
10787 // Vérifier d'abord si Ollama est disponible
10789 Alert alert = new Alert(Alert.AlertType.WARNING);
10790 alert.setTitle(rbLocalisation.getString("main.descriptionIAOllamaIndisponible"));
10791 alert.setHeaderText(rbLocalisation.getString("main.descriptionIAOllamaIndisponible"));
10792 alert.setContentText(rbLocalisation.getString("main.descriptionIAOllamaIndisponibleMsg"));
10793 alert.showAndWait();
10794 return;
10795 }
10796
10797 // Récupérer les informations disponibles
10798 String titreVisite = null;
10799 TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
10800 if (tfVisite != null && !tfVisite.getText().isEmpty()) {
10801 titreVisite = tfVisite.getText();
10802 }
10803
10804 String titrePanoramique = getPanoramiquesProjet()[getiPanoActuel()].getStrTitrePanoramique();
10805 String latitude = null;
10806 String longitude = null;
10807
10808 // Récupérer les coordonnées GPS si disponibles
10809 CoordonneesGeographiques coords = getPanoramiquesProjet()[getiPanoActuel()].getMarqueurGeolocatisation();
10810 if (coords != null) {
10811 latitude = String.valueOf(coords.getLatitude());
10812 longitude = String.valueOf(coords.getLongitude());
10813 }
10814
10815 // Vérifier qu'au moins une donnée est disponible
10816 boolean hasTitreVisite = titreVisite != null && !titreVisite.trim().isEmpty();
10817 boolean hasTitrePano = titrePanoramique != null && !titrePanoramique.trim().isEmpty();
10818 boolean hasCoords = latitude != null && longitude != null;
10819
10820 if (!hasTitreVisite && !hasTitrePano && !hasCoords) {
10821 Alert alert = new Alert(Alert.AlertType.WARNING);
10822 alert.setTitle(rbLocalisation.getString("main.descriptionIADonneesManquantes"));
10823 alert.setHeaderText(rbLocalisation.getString("main.descriptionIADonneesManquantes"));
10824 alert.setContentText(rbLocalisation.getString("main.descriptionIADonneesManquantesMsg"));
10825 alert.showAndWait();
10826 return;
10827 }
10828
10829 // Afficher un indicateur de chargement avec le service utilisé
10832 taDescriptionIA.setText(rbLocalisation.getString("main.descriptionIAGeneration") + "\nService: " + serviceInfo);
10833 taDescriptionIA.setDisable(true);
10834
10835 // Appeler l'API IA de manière asynchrone
10836 OllamaService.genererDescription(titreVisite, titrePanoramique, latitude, longitude, getLocale())
10837 .thenAccept(description -> {
10838 // Mettre à jour l'UI dans le thread JavaFX
10839 Platform.runLater(() -> {
10841 taDescriptionIA.setDisable(false);
10842
10843 // Sauvegarder automatiquement
10844 System.out.println("[DEBUG] Sauvegarde description IA pour pano " + getiPanoActuel());
10845 System.out.println("[DEBUG] Description générée (longueur: " + description.length() + "): '" + description.substring(0, Math.min(100, description.length())) + "...'");
10846 getPanoramiquesProjet()[getiPanoActuel()].setStrDescriptionIA(description);
10847 String verif = getPanoramiquesProjet()[getiPanoActuel()].getStrDescriptionIA();
10848 System.out.println("[DEBUG] Vérification après set (longueur: " + verif.length() + "): '" + verif.substring(0, Math.min(100, verif.length())) + "...'");
10849 setbDejaSauve(false);
10850 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
10851 });
10852 })
10853 .exceptionally(ex -> {
10854 // Gérer les erreurs
10855 Platform.runLater(() -> {
10857 taDescriptionIA.setDisable(false);
10858
10859 Alert alert = new Alert(Alert.AlertType.ERROR);
10860 alert.setTitle(rbLocalisation.getString("main.descriptionIAErreur"));
10861 alert.setHeaderText(rbLocalisation.getString("main.descriptionIAErreur"));
10862 alert.setContentText(ex.getMessage());
10863 alert.showAndWait();
10864 });
10865 return null;
10866 });
10867 }
10868
10876 int iLargeur = (int) imgRect.getWidth() / iRapport;
10877 int iHauteur = iLargeur / 2 / iRapport;
10879 PixelReader prRect = imgRect.getPixelReader();
10880 PixelWriter pwMercator = imgMercator.getPixelWriter();
10881 for (int i = 0; i < iLargeur; i++) {
10882 for (int j = 0; j < iHauteur; j++) {
10883 double phi = Math.asin(2.d * (iHauteur / 2.d - j) / iHauteur);
10884 int y2 = (int) (iHauteur * iRapport * (0.5d - phi / Math.PI));
10885 if (y2 >= iHauteur * iRapport) {
10886 y2 = iHauteur * iRapport - 1;
10887 }
10888 Color clPixel = prRect.getColor(i * iRapport, y2 * iRapport);
10889 pwMercator.setColor(i, j, clPixel);
10890 }
10891 }
10892 return imgMercator;
10893 }
10894
10903 @SuppressWarnings("empty-statement")
10905 bPanoCharge = true;
10906 bEstCharge = true;
10908 if (typePano.equals(Panoramique.SPHERE)) {
10910 if (!jpegFile.exists()) {
10911 jpegFile = new File(getStrRepertAppli() + File.separator + "images" + File.separator + "pasImage.jpg");
10912 }
10913 try {
10915 for (Directory directory : metadata.getDirectories()) {
10916 System.out.println("Directory: " + directory.getName());
10917 for (String error : directory.getErrors()) {
10918 System.out.println("> error: " + error);
10919 }
10920 directory.getTags().stream().forEach((tag) -> {
10921 System.out.println("> tag: " + tag.getTagName() + " = " + tag.getDescription());
10922 });
10923 }
10925 Logger.getLogger(EditeurPanovisu.class
10926 .getName()).log(Level.SEVERE, null, ex);
10927 }
10928 panoCree.setStrNomFichier(strFichierPano);
10929 int iNombreNiveaux = iCreeNiveauxImageEqui(jpegFile.getAbsolutePath(), strFichierPano, getStrRepertPanos(), getiNombrePanoramiques(), iNumero, iTotal);
10930 Platform.runLater(() -> {
10931 lblNiveaux.setText("Création visualisation panoramique");
10932 pbarAvanceChargement.setProgress((double) (iNumero - 1) / (double) iTotal + 0.666 / iTotal);
10933 });
10934
10935 panoCree.setStrNomFichier(strFichierPano);
10936 Image imgPano3 = null;
10937 Image imgPano4 = null;
10938 Image imgPano5 = null;
10939 String strExtension = jpegFile.getAbsolutePath().substring(jpegFile.getAbsolutePath().length() - 3, jpegFile.getAbsolutePath().length());
10940 if ("tif".equals(strExtension)) {
10941 try {
10942 imgPanoRetaille2 = ReadWriteImage.readTiff(jpegFile.getAbsolutePath());
10943 imgPanoRetaille2 = ReadWriteImage.resizeImage(imgPanoRetaille2, 1200, 600);
10944
10945 String nomVignette = jpegFile.getAbsolutePath().substring(0, jpegFile.getAbsolutePath().lastIndexOf(".")) + "Vignette.jpg";
10946 File ficVig = new File(nomVignette);
10947 if (ficVig.exists()) {
10948 imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
10949 imgPano4 = ReadWriteImage.readTiff(jpegFile.getAbsolutePath());
10952 } else {
10953 imgPano3 = ReadWriteImage.readTiff(jpegFile.getAbsolutePath());
10957 }
10958 panoCree.setImgVisuPanoramique(imgTransformationImage(ReadWriteImage.readTiff(jpegFile.getAbsolutePath()), 2));
10959
10960 } catch (IOException ex) {
10961 Logger.getLogger(EditeurPanovisu.class
10962 .getName()).log(Level.SEVERE, null, ex);
10963 }
10964 } else {
10965 imgPanoRetaille2 = new Image("file:" + jpegFile.getAbsolutePath(), 1200, 600, true, true, true);
10966 imgPano5 = new Image("file:" + jpegFile.getAbsolutePath(), 70, 35, true, true, true);
10967 imgPano4 = new Image("file:" + jpegFile.getAbsolutePath(), 300, 150, true, true, true);
10969
10970 String nomVignette = jpegFile.getAbsolutePath().substring(0, jpegFile.getAbsolutePath().lastIndexOf(".")) + "Vignette.jpg";
10971 File ficVig = new File(nomVignette);
10972 if (ficVig.exists()) {
10973 imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
10974 }
10975 panoCree.setImgVisuPanoramique(imgTransformationImage(new Image("file:" + jpegFile.getAbsolutePath()), 2));
10976 }
10977
10978 // 🚀 PRÉ-CALCUL pour optimiser l'affichage des visualiseurs
10979 System.out.println("🚀 Pré-calcul pour le nouveau panorama " + getiNombrePanoramiques());
10980 Image imgPanoSource = new Image("file:" + jpegFile.getAbsolutePath());
10981
10982 // Image haute résolution pour le mode plein écran (iRapport=1)
10983 System.out.println(" 📸 Pré-chargement image haute résolution...");
10984 Image imgHauteRes = imgTransformationImage(imgPanoSource, 1);
10985 panoCree.setImgHauteResolution(imgHauteRes);
10986
10987 // Cube petite résolution (500×500) pour le petit visualiseur
10988 System.out.println(" 📦 Calcul des faces 500×500...");
10990 panoCree.setCubeFacesPetiteResolution(cubesPetits);
10991
10992 // Cube grande résolution (1000×1000) pour le visualiseur plein écran
10993 System.out.println(" 📦 Calcul des faces 1000×1000...");
10995 panoCree.setCubeFacesGrandeResolution(cubesGrands);
10996 System.out.println(" ✅ Pré-calcul terminé");
10997
10998 panoCree.setImgPanoramique(imgPanoRetaille2);
10999 panoCree.setNombreNiveaux(iNombreNiveaux);
11000 panoCree.setImgVignettePanoramique(imgPano3);
11001 panoCree.setImgPanoRect(imgPano4);
11002 panoCree.setImgPanoRectListe(imgPano5);
11003 panoCree.setStrTypePanoramique(Panoramique.SPHERE);
11004 }
11005 if (typePano.equals(Panoramique.CUBE)) {
11006 panoCree.setStrNomFichier(strFichierPano);
11007 panoCree.setStrNomFichier(strFichierPano);
11008 String strNom = strFichierPano.substring(0, strFichierPano.length() - 6);
11009 String strExtension = strFichierPano.substring(strFichierPano.length() - 3, strFichierPano.length());
11010 Image imgTop = null;
11011 Image imgBottom = null;
11012 Image imgLeft = null;
11013 Image imgRight = null;
11014 Image imgFront = null;
11015 Image imgBehind = null;
11016 if (strExtension.equals("bmp")) {
11017 imgTop = new Image("file:" + strNom + "_u.bmp");
11018 imgBottom = new Image("file:" + strNom + "_d.bmp");
11019 imgLeft = new Image("file:" + strNom + "_l.bmp");
11020 imgRight = new Image("file:" + strNom + "_r.bmp");
11021 imgFront = new Image("file:" + strNom + "_f.bmp");
11022 imgBehind = new Image("file:" + strNom + "_b.bmp");
11023 }
11024 if (strExtension.equals("jpg")) {
11025 imgTop = new Image("file:" + strNom + "_u.jpg");
11026 imgBottom = new Image("file:" + strNom + "_d.jpg");
11027 imgLeft = new Image("file:" + strNom + "_l.jpg");
11028 imgRight = new Image("file:" + strNom + "_r.jpg");
11029 imgFront = new Image("file:" + strNom + "_f.jpg");
11030 imgBehind = new Image("file:" + strNom + "_b.jpg");
11031 }
11032 if (strExtension.equals("tif")) {
11033 try {
11034 imgTop = ReadWriteImage.readTiff(strNom + "_u.tif");
11036 imgLeft = ReadWriteImage.readTiff(strNom + "_l.tif");
11037 imgRight = ReadWriteImage.readTiff(strNom + "_r.tif");
11038 imgFront = ReadWriteImage.readTiff(strNom + "_f.tif");
11040
11041 } catch (IOException ex) {
11042 Logger.getLogger(EditeurPanovisu.class
11043 .getName()).log(Level.SEVERE, null, ex);
11044 }
11045 }
11048 panoCree.setImgCubeEqui(imgEquiRectangulaire2);
11051 panoCree.setImgPanoramique(imgEquiRectangulaire);
11052 Platform.runLater(() -> {
11053 lblNiveaux.setText("Création visualisation panoramique");
11054 pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 1.d / 3.d) / iTotal);
11055 });
11056
11057 panoCree.setImgVisuPanoramique(imgTransformationImage(imgEquiRectangulaire2, 1));
11058 int iNombreNiveaux = iCreeNiveauxImageCube(strNom + "_u." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(), "dessus");
11059 Platform.runLater(() -> {
11060 pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 4.d / 9.d) / (double) iTotal);
11061 });
11062
11063 iCreeNiveauxImageCube(strNom + "_d." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(), "dessous");
11064 Platform.runLater(() -> {
11065 pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 5.d / 9.d) / (double) iTotal);
11066 });
11067 iCreeNiveauxImageCube(strNom + "_l." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(), "gauche");
11068 Platform.runLater(() -> {
11069 pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 2.d / 3.d) / (double) iTotal);
11070 });
11071
11072 iCreeNiveauxImageCube(strNom + "_r." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(), "droite");
11073 Platform.runLater(() -> {
11074 pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 7.d / 9.d) / (double) iTotal);
11075 });
11076
11077 iCreeNiveauxImageCube(strNom + "_f." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(), "devant");
11078 Platform.runLater(() -> {
11079 pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 8.d / 9.d) / (double) iTotal);
11080 });
11081
11082 iCreeNiveauxImageCube(strNom + "_b." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(), "derriere");
11083 Platform.runLater(() -> {
11084 pbarAvanceChargement.setProgress(((double) (iNumero)) / (double) iTotal);
11085 });
11086 String nomVignette = strFichierPano.substring(0, strFichierPano.lastIndexOf(".")) + "Vignette.jpg";
11087 File ficVig = new File(nomVignette);
11090
11091 if (ficVig.exists()) {
11092 imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
11094 } else {
11097 }
11098
11099 panoCree.setNombreNiveaux(iNombreNiveaux);
11100 panoCree.setImgVignettePanoramique(imgPano3);
11101 panoCree.setImgPanoRect(imgPano4);
11102 panoCree.setImgPanoRectListe(imgPano5);
11103 panoCree.setStrTypePanoramique(Panoramique.CUBE);
11104 }
11105
11106 panoCree.setRegardX(0.0d);
11107 panoCree.setRegardY(0.0d);
11108 panoCree.setAfficheInfo(true);
11109 panoCree.setAfficheTitre(true);
11110 panoCree.setStrTitrePanoramique("");
11111 getPanoramiquesProjet()[getiNombrePanoramiques()] = panoCree;
11112 setiPanoActuel(getiNombrePanoramiques());
11113 setiNombrePanoramiques(getiNombrePanoramiques() + 1);
11114
11115 }
11116
11117 @SuppressWarnings("empty-statement")
11119 bPanoCharge = true;
11120 bEstCharge = true;
11121 if (typePano.equals(Panoramique.SPHERE)) {
11123 if (!imageFile.exists()) {
11124 imageFile = new File(getStrRepertAppli() + File.separator + "images" + File.separator + "pasImage.jpg");
11125 }
11126 try {
11128 for (Directory directory : metadata.getDirectories()) {
11129 System.out.println("Directory: " + directory.getName());
11130
11131 // Log all errors.
11132 for (String error : directory.getErrors()) {
11133 System.out.println("> error: " + error);
11134 }
11135
11136 // Log all tags.
11137 directory.getTags().stream().forEach((tag) -> {
11138 System.out.println("> tag: " + tag.getTagName() + " = " + tag.getDescription());
11139 });
11140
11141 }
11143 Logger.getLogger(EditeurPanovisu.class
11144 .getName()).log(Level.SEVERE, null, ex);
11145 }
11146 getPanoramiquesProjet()[getiPanoActuel()].setStrNomFichier(strFichierPano);
11147 int iNum = getiPanoActuel();
11148 int iNombreNiveaux = iCreeNiveauxImageEqui(imageFile.getAbsolutePath(), strFichierPano, getStrRepertPanos(), iNum, 0, 0);
11149 Image imgPano3 = null;
11150 Image imgPano4 = null;
11151 Image imgPano5 = null;
11152 String strExtension = imageFile.getAbsolutePath().substring(imageFile.getAbsolutePath().length() - 3, imageFile.getAbsolutePath().length());
11153 if ("tif".equals(strExtension)) {
11154 try {
11155 imgPanoRetaille2 = ReadWriteImage.readTiff(imageFile.getAbsolutePath());
11156 imgPanoRetaille2 = ReadWriteImage.resizeImage(imgPanoRetaille2, 1200, 600);
11157
11158 String nomVignette = imageFile.getAbsolutePath().substring(0, imageFile.getAbsolutePath().lastIndexOf(".")) + "Vignette.jpg";
11159 File ficVig = new File(nomVignette);
11160 if (ficVig.exists()) {
11161 imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
11162 imgPano4 = ReadWriteImage.readTiff(imageFile.getAbsolutePath());
11165 } else {
11166 imgPano3 = ReadWriteImage.readTiff(imageFile.getAbsolutePath());
11170 }
11171 getPanoramiquesProjet()[getiPanoActuel()].setImgVisuPanoramique(imgTransformationImage(ReadWriteImage.readTiff(imageFile.getAbsolutePath()), 2));
11172
11173 } catch (IOException ex) {
11174 Logger.getLogger(EditeurPanovisu.class
11175 .getName()).log(Level.SEVERE, null, ex);
11176 }
11177 } else {
11178 imgPanoRetaille2 = new Image("file:" + imageFile.getAbsolutePath(), 1200, 600, true, true, true);
11179 imgPano5 = new Image("file:" + imageFile.getAbsolutePath(), 70, 35, true, true, true);
11180 String nomVignette = imageFile.getAbsolutePath().substring(0, imageFile.getAbsolutePath().lastIndexOf(".")) + "Vignette.jpg";
11181 File ficVig = new File(nomVignette);
11182 if (ficVig.exists()) {
11183 imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
11184 imgPano4 = new Image("file:" + imageFile.getAbsolutePath(), 300, 150, true, true, true);
11185 } else {
11186 imgPano3 = new Image("file:" + imageFile.getAbsolutePath(), 300, 150, true, true, true);
11188 }
11189 getPanoramiquesProjet()[getiPanoActuel()].setImgVisuPanoramique(imgTransformationImage(new Image("file:" + imageFile.getAbsolutePath()), 2));
11190 }
11191 getPanoramiquesProjet()[getiPanoActuel()].setImgPanoramique(imgPanoRetaille2);
11192 getPanoramiquesProjet()[getiPanoActuel()].setNombreNiveaux(iNombreNiveaux);
11193 getPanoramiquesProjet()[getiPanoActuel()].setImgVignettePanoramique(imgPano3);
11194 getPanoramiquesProjet()[getiPanoActuel()].setImgPanoRect(imgPano4);
11195 getPanoramiquesProjet()[getiPanoActuel()].setImgPanoRectListe(imgPano5);
11196
11197 // 🚀 PRÉ-CALCUL pour optimiser l'affichage des visualiseurs
11198 System.out.println("🚀 Pré-calcul pour le panorama " + getiPanoActuel());
11199 Image imgPanoSource = new Image("file:" + imageFile.getAbsolutePath());
11200
11201 // Image haute résolution pour le mode plein écran (iRapport=1)
11202 System.out.println(" 📸 Pré-chargement image haute résolution...");
11203 Image imgHauteRes = imgTransformationImage(imgPanoSource, 1);
11204 getPanoramiquesProjet()[getiPanoActuel()].setImgHauteResolution(imgHauteRes);
11205
11206 // Cube petite résolution (500×500) pour le petit visualiseur
11207 try {
11209 getPanoramiquesProjet()[getiPanoActuel()].setCubeFacesPetiteResolution(cubesPetits);
11210 System.out.println(" ✅ Cube 500×500 pré-calculé et stocké");
11211 } catch (InterruptedException ex) {
11212 System.err.println(" ⚠️ Échec pré-calcul cube 500×500");
11213 }
11214
11215 // Cube grande résolution (1000×1000) pour le grand visualiseur
11216 try {
11218 getPanoramiquesProjet()[getiPanoActuel()].setCubeFacesGrandeResolution(cubesGrands);
11219 System.out.println(" ✅ Cube 1000×1000 pré-calculé et stocké");
11220 } catch (InterruptedException ex) {
11221 System.err.println(" ⚠️ Échec pré-calcul cube 1000×1000");
11222 }
11223
11224 getPanoramiquesProjet()[getiPanoActuel()].setStrTypePanoramique(Panoramique.SPHERE);
11225 }
11226 if (typePano.equals(Panoramique.CUBE)) {
11227 getPanoramiquesProjet()[getiPanoActuel()].setStrNomFichier(strFichierPano);
11228 String strNom = strFichierPano.substring(0, strFichierPano.length() - 6);
11229 String strExtension = strFichierPano.substring(strFichierPano.length() - 3, strFichierPano.length());
11230 Image imgTop = null;
11231 Image imgBottom = null;
11232 Image imgLeft = null;
11233 Image imgRight = null;
11234 Image imgFront = null;
11235 Image imgBehind = null;
11236 if (strExtension.equals("bmp")) {
11237 imgTop = new Image("file:" + strNom + "_u.bmp");
11238 imgBottom = new Image("file:" + strNom + "_d.bmp");
11239 imgLeft = new Image("file:" + strNom + "_l.bmp");
11240 imgRight = new Image("file:" + strNom + "_r.bmp");
11241 imgFront = new Image("file:" + strNom + "_f.bmp");
11242 imgBehind = new Image("file:" + strNom + "_b.bmp");
11243 }
11244 if (strExtension.equals("jpg")) {
11245 imgTop = new Image("file:" + strNom + "_u.jpg");
11246 imgBottom = new Image("file:" + strNom + "_d.jpg");
11247 imgLeft = new Image("file:" + strNom + "_l.jpg");
11248 imgRight = new Image("file:" + strNom + "_r.jpg");
11249 imgFront = new Image("file:" + strNom + "_f.jpg");
11250 imgBehind = new Image("file:" + strNom + "_b.jpg");
11251 }
11252 if (strExtension.equals("tif")) {
11253 try {
11254 imgTop = ReadWriteImage.readTiff(strNom + "_u.tif");
11256 imgLeft = ReadWriteImage.readTiff(strNom + "_l.tif");
11257 imgRight = ReadWriteImage.readTiff(strNom + "_r.tif");
11258 imgFront = ReadWriteImage.readTiff(strNom + "_f.tif");
11260
11261 } catch (IOException ex) {
11262 Logger.getLogger(EditeurPanovisu.class
11263 .getName()).log(Level.SEVERE, null, ex);
11264 }
11265 }
11270 getPanoramiquesProjet()[getiPanoActuel()].setImgPanoramique(imgEquiRectangulaire);
11271
11272 getPanoramiquesProjet()[getiPanoActuel()].setImgVisuPanoramique(imgTransformationImage(imgEquiRectangulaire2, 1));
11273 int iNum = getiPanoActuel();
11274 int iNombreNiveaux = iCreeNiveauxImageCube(strNom + "_u." + strExtension, getStrRepertPanos(), iNum, "dessus");
11275 iCreeNiveauxImageCube(strNom + "_d." + strExtension, getStrRepertPanos(), iNum, "dessous");
11276 iCreeNiveauxImageCube(strNom + "_l." + strExtension, getStrRepertPanos(), iNum, "gauche");
11277 iCreeNiveauxImageCube(strNom + "_r." + strExtension, getStrRepertPanos(), iNum, "droite");
11278 iCreeNiveauxImageCube(strNom + "_f." + strExtension, getStrRepertPanos(), iNum, "devant");
11279 iCreeNiveauxImageCube(strNom + "_b." + strExtension, getStrRepertPanos(), iNum, "derriere");
11280 String nomVignette = strFichierPano.substring(0, strFichierPano.lastIndexOf(".")) + "Vignette.jpg";
11281 File ficVig = new File(nomVignette);
11284 if (ficVig.exists()) {
11285 imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
11287 } else {
11290 }
11291
11292 getPanoramiquesProjet()[getiPanoActuel()].setNombreNiveaux(iNombreNiveaux);
11293 getPanoramiquesProjet()[getiPanoActuel()].setImgVignettePanoramique(imgPano3);
11294 getPanoramiquesProjet()[getiPanoActuel()].setImgPanoRect(imgPano4);
11295 getPanoramiquesProjet()[getiPanoActuel()].setImgPanoRectListe(imgPano5);
11296 getPanoramiquesProjet()[getiPanoActuel()].setStrTypePanoramique(Panoramique.CUBE);
11297 }
11298
11299 }
11300
11304 private static void transformationCube2Equi() {
11306 try {
11308
11309 } catch (Exception ex) {
11310 Logger.getLogger(EditeurPanovisu.class
11311 .getName()).log(Level.SEVERE, null, ex);
11312 }
11313 }
11314
11318 private static void transformationEqui2Cube() {
11320 try {
11322
11323 } catch (Exception ex) {
11324 Logger.getLogger(EditeurPanovisu.class
11325 .getName()).log(Level.SEVERE, null, ex);
11326 }
11327 }
11328
11347 try {
11348 controller.afficheFenetre();
11349 } catch (Exception ex) {
11350 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
11351 }
11352 }
11353
11372 private static void ouvrirOutilConversionRatio2to1() {
11374 try {
11375 controller.afficheFenetre();
11376 } catch (Exception ex) {
11377 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
11378 }
11379 }
11380
11385 private static void modeleSauver() throws IOException {
11388 FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("fichier Modèle panoVisu (*.tpl)", "*.tpl");
11389 fcRepertChoix.getExtensionFilters().add(extFilter);
11390 File fileRepert = new File(getStrRepertAppli() + File.separator + "templates");
11391 if (!fileRepert.exists()) {
11392 fileRepert.mkdirs();
11393 }
11394 fcRepertChoix.setInitialDirectory(fileRepert);
11395 fileTemplate = fcRepertChoix.showSaveDialog(null);
11396
11397 if (fileTemplate != null) {
11398 String strContenuFichier = getGestionnaireInterface().strGetTemplate();
11399 fileTemplate.setWritable(true);
11403 }
11404 Alert alert = new Alert(AlertType.INFORMATION);
11405 alert.setTitle(rbLocalisation.getString("main.dialog.sauveModele"));
11406 alert.setHeaderText(null);
11407 alert.setContentText(rbLocalisation.getString("main.dialog.sauveModeleMessage"));
11408 alert.showAndWait();
11409 }
11410
11411 }
11412
11417 private static void modeleCharger() throws IOException {
11419 FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("fichier panoVisu (*.tpl)", "*.tpl");
11420 fileRepertChoix.getExtensionFilters().add(extFilter);
11421 File repert = new File(getStrRepertAppli() + File.separator + "templates");
11422 fileRepertChoix.setInitialDirectory(repert);
11423 File filetemplate = fileRepertChoix.showOpenDialog(getStPrincipal());
11424 if (filetemplate != null) {
11425 try {
11428 new FileInputStream(filetemplate), "UTF-8"));
11429
11431 while ((strLigneTexte = brTemplate.readLine()) != null) {
11433 }
11434 getGestionnaireInterface().setbTemplate(true);
11435 getGestionnaireInterface().setTemplate(strListTemplate);
11436 boolean bSauve = isbDejaSauve();
11437 getGestionnaireInterface().afficheTemplate();
11438 setbDejaSauve(bSauve);
11439 if (bSauve) {
11440 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", ""));
11441 } else {
11442 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
11443 }
11444 getGestionnaireInterface().setbTemplate(false);
11445
11446 } catch (FileNotFoundException ex) {
11447 Logger.getLogger(EditeurPanovisu.class
11448 .getName()).log(Level.SEVERE, null, ex);
11449 }
11450
11451 }
11452
11453 }
11454
11463 ObservableList<AncreForme> olAnchors = FXCollections.observableArrayList();
11464
11465 for (int i = 0; i < points.size(); i += 2) {
11466 final int idx = i;
11467
11470
11472 points.set(idx, (double) x);
11473 String chaine = "";
11474 chaine = points.stream().map((point) -> point.toString() + ",").reduce(chaine, String::concat);
11475 chaine = chaine.substring(0, chaine.length() - 1);
11477 });
11478
11480 points.set(idx + 1, (double) y);
11481 String chaine = "";
11482 chaine = points.stream().map((point) -> point.toString() + ",").reduce(chaine, String::concat);
11483 chaine = chaine.substring(0, chaine.length() - 1);
11485 });
11486
11487 olAnchors.add(new AncreForme(Color.GOLD, xProperty, yProperty));
11488 }
11489
11490 return olAnchors;
11491 }
11492
11500 Circle cercle) {
11501 ObservableList<AncreForme> olAnchors = FXCollections.observableArrayList();
11502
11506 DoubleProperty xProperty2 = new SimpleDoubleProperty(cercle.getCenterX() + cercle.getRadius());
11508 final AncreForme ancRayon = new AncreForme(Color.BLUEVIOLET, xProperty2, yProperty2);
11509 olAnchors.add(ancRayon);
11511 double dX = (double) x - cercle.getCenterX();
11512 double rayon = Math.sqrt(Math.pow(cercle.getCenterX() - xProperty2.get(), 2.d) + Math.pow(cercle.getCenterY() - yProperty2.get(), 2.d));
11513 cercle.setCenterX((double) x);
11514 ancRayon.setCenterX(ancRayon.getCenterX() + dX);
11515 String chaine = Math.round(cercle.getCenterX() * 10) / 10 + "," + Math.round(cercle.getCenterY() * 10) / 10 + "," + Math.round(rayon * 10) / 10;
11517
11518 });
11519
11521 double dY = -cercle.getCenterY() + (double) y;
11522 double rayon = Math.sqrt(Math.pow(cercle.getCenterX() - xProperty2.get(), 2.d) + Math.pow(cercle.getCenterY() - yProperty2.get(), 2.d));
11523 cercle.setCenterY((double) y);
11524 ancRayon.setCenterY(ancRayon.getCenterY() + dY);
11525 String chaine = Math.round(cercle.getCenterX() * 10) / 10 + "," + Math.round(cercle.getCenterY() * 10) / 10 + "," + Math.round(rayon * 10) / 10;
11527 });
11529 double rayon = Math.sqrt(Math.pow(cercle.getCenterX() - (double) x, 2.d) + Math.pow(cercle.getCenterY() - yProperty2.get(), 2.d));
11530 cercle.setRadius(rayon);
11531 String chaine = Math.round(cercle.getCenterX() * 10) / 10 + "," + Math.round(cercle.getCenterY() * 10) / 10 + "," + Math.round(rayon * 10) / 10;
11533 });
11534
11536 double rayon = Math.sqrt(Math.pow(cercle.getCenterX() - xProperty2.get(), 2.d) + Math.pow(cercle.getCenterY() - (double) y, 2.d));
11537 cercle.setRadius(rayon);
11538 String chaine = Math.round(cercle.getCenterX() * 10) / 10 + "," + Math.round(cercle.getCenterY() * 10) / 10 + "," + Math.round(rayon * 10) / 10;
11540 });
11541
11542 return olAnchors;
11543 }
11544
11552 Rectangle rect) {
11553 ObservableList<AncreForme> olAnchors = FXCollections.observableArrayList();
11554
11557 DoubleProperty xProperty2 = new SimpleDoubleProperty(rect.getWidth() + rect.getX());
11558 DoubleProperty yProperty2 = new SimpleDoubleProperty(rect.getHeight() + rect.getY());
11563 double dX = -rect.getX() + (double) x;
11564 rect.setX((double) x);
11565 ancrePoint2.setCenterX(ancrePoint2.getCenterX() + dX);
11566 String chaine = Math.round(rect.getX() * 10) / 10
11567 + "," + Math.round(rect.getY() * 10) / 10
11568 + "," + Math.round((rect.getX() + rect.getWidth()) * 10) / 10
11569 + "," + Math.round((rect.getY() + rect.getHeight()) * 10) / 10;
11571 });
11572
11574 double dY = -rect.getY() + (double) y;
11575 rect.setY((double) y);
11576 ancrePoint2.setCenterY(ancrePoint2.getCenterY() + dY);
11577 String chaine = Math.round(rect.getX() * 10) / 10
11578 + "," + Math.round(rect.getY() * 10) / 10
11579 + "," + Math.round((rect.getX() + rect.getWidth()) * 10) / 10
11580 + "," + Math.round((rect.getY() + rect.getHeight()) * 10) / 10;
11582 });
11584 rect.setWidth((double) x - rect.getX());
11585 String chaine = Math.round(rect.getX() * 10) / 10
11586 + "," + Math.round(rect.getY() * 10) / 10
11587 + "," + Math.round((rect.getX() + rect.getWidth()) * 10) / 10
11588 + "," + Math.round((rect.getY() + rect.getHeight()) * 10) / 10;
11590 });
11591
11593 rect.setHeight((double) y - rect.getY());
11594 String chaine = Math.round(rect.getX() * 10) / 10
11595 + "," + Math.round(rect.getY() * 10) / 10
11596 + "," + Math.round((rect.getX() + rect.getWidth()) * 10) / 10
11597 + "," + Math.round((rect.getY() + rect.getHeight()) * 10) / 10;
11599 });
11600
11601 return olAnchors;
11602 }
11603
11612 private static void choixZone(int iLargeur, int iHauteur, boolean bMasqueZones, String strIdZone, MouseEvent mouseEvent) {
11613 final int iNumeroZone = Integer.parseInt(strIdZone.split("-")[1]);
11614 if (mouseEvent.getButton().equals(MouseButton.PRIMARY)) {
11615 if (mouseEvent.getClickCount() == 2) {
11616 for (int ij = iNumeroZone; ij < iNombreZones - 1; ij++) {
11617 zones[ij] = zones[ij + 1];
11618 }
11619 iNombreZones--;
11620 afficheBarrePersonnalisee(iLargeur, iHauteur, bMasqueZones);
11621 } else {
11622 afficheBarrePersonnalisee(iLargeur, iHauteur, bMasqueZones);
11623 apZoneBarrePersonnalisee.getChildren().clear();
11624
11626
11627 // ComboBox moderne pour le choix de touche
11629 cbTouchesBarre.getItems().clear();
11630 for (int i = 0; i < strTouchesBarre.length; i++) {
11631 cbTouchesBarre.getItems().add(i, strTouchesBarre[i]);
11632 }
11633 cbTouchesBarre.setLayoutX(20);
11634 cbTouchesBarre.setLayoutY(30); // Décalé de 30px vers le bas
11635 cbTouchesBarre.setPrefWidth(295);
11636
11637 // Trouver l'index de l'action de la zone et sélectionner dans la ComboBox
11638 int index = -1;
11639 for (int ij = 0; ij < strCodeBarre.length; ij++) {
11640 if (strCodeBarre[ij].equals(zone.getStrIdZone())) {
11641 index = ij;
11642 }
11643 }
11644 if (index != -1) {
11645 cbTouchesBarre.getSelectionModel().select(index);
11646 }
11647
11648 // Utiliser une CellFactory pour forcer le style des items (fond blanc, texte noir)
11649 cbTouchesBarre.setCellFactory(param -> new javafx.scene.control.ListCell<String>() {
11650 @Override
11651 protected void updateItem(String item, boolean empty) {
11652 super.updateItem(item, empty);
11653 if (empty || item == null) {
11654 setText(null);
11655 setStyle("");
11656 } else {
11657 setText(item);
11658 setStyle(
11659 ""
11660 );
11661 }
11662 }
11663 });
11664
11665 // Style pour le bouton de la ComboBox (affichage de la valeur sélectionnée)
11666 cbTouchesBarre.setButtonCell(new javafx.scene.control.ListCell<String>() {
11667 @Override
11668 protected void updateItem(String item, boolean empty) {
11669 super.updateItem(item, empty);
11670 if (empty || item == null) {
11671 setText(null);
11672 } else {
11673 setText(item);
11674 setStyle(null);
11675 }
11676 }
11677 });
11678
11679 // Label titre pour la section
11680 Label lblTitreZone = new Label("Zone sélectionnée");
11681 lblTitreZone.setLayoutX(20);
11682 lblTitreZone.setLayoutY(5);
11683
11684 // Ajouter les éléments au panel
11685 apZoneBarrePersonnalisee.getChildren().addAll(lblTitreZone, cbTouchesBarre);
11686
11687 cbTouchesBarre.valueProperty().addListener((ov, ancienneValeur, nouvelleValeur) -> {
11688 if (nouvelleValeur != null) {
11689 String strId = strCodeBarre[cbTouchesBarre.getSelectionModel().getSelectedIndex()];
11691 }
11692 });
11693
11694 // Label Type avec style moderne
11695 Label lblTypeLabel = new Label("Type :");
11696 lblTypeLabel.setLayoutX(20);
11697 lblTypeLabel.setLayoutY(70);
11698
11699 Label lblTypeBarre = new Label(zone.getStrTypeZone());
11700 lblTypeBarre.setLayoutX(70);
11701 lblTypeBarre.setLayoutY(70);
11702
11703 // Label Coordonnées avec style moderne
11704 Label lblCoordsLabel = new Label("Coordonnées :");
11705 lblCoordsLabel.setLayoutX(20);
11706 lblCoordsLabel.setLayoutY(95);
11707
11708 Label lblCoordsBarre = new Label(zone.getStrCoordonneesZone());
11709 lblCoordsBarre.setLayoutX(20);
11710 lblCoordsBarre.setLayoutY(115);
11711 lblCoordsBarre.setPrefWidth(295);
11712 lblCoordsBarre.setMaxWidth(295);
11713 lblCoordsBarre.setWrapText(true);
11714
11715 apZoneBarrePersonnalisee.getChildren()
11717 switch (zone.getStrTypeZone()) {
11718 case "poly":
11719 Polygon poly = (Polygon) apImgBarrePersonnalisee.lookup("#" + strIdZone);
11720 poly.setFill(Color.rgb(255, 0, 0, 0.5));
11721 poly.setStroke(Color.YELLOW);
11722 apImgBarrePersonnalisee.getChildren().addAll(olCreeAncresPourPolygone(iNumeroZone, poly.getPoints()));
11723 break;
11724 case "rect":
11725 Rectangle rect = (Rectangle) apImgBarrePersonnalisee.lookup("#" + strIdZone);
11726 rect.setFill(Color.rgb(255, 0, 0, 0.5));
11727 rect.setStroke(Color.YELLOW);
11728 apImgBarrePersonnalisee.getChildren().addAll(olCreeAncresPourRectangle(iNumeroZone, rect));
11729 break;
11730 case "circle":
11731 Circle cercle = (Circle) apImgBarrePersonnalisee.lookup("#" + strIdZone);
11732 cercle.setFill(Color.rgb(255, 0, 0, 0.5));
11733 cercle.setStroke(Color.YELLOW);
11734 apImgBarrePersonnalisee.getChildren().addAll(olCreeAncresPourCercle(iNumeroZone, cercle));
11735 break;
11736 }
11737
11738 }
11739 }
11740
11741 }
11742
11749 private static void afficheBarrePersonnalisee(int iLargeur, int iHauteur, boolean bMasqueZones) {
11750 apImgBarrePersonnalisee.getChildren().clear();
11751 apZoneBarrePersonnalisee.getChildren().clear();
11752 ImageView ivBarrePersonnalisee = new ImageView(imgBarrePersonnalisee);
11753 apImgBarrePersonnalisee.getChildren().add(ivBarrePersonnalisee);
11754 apImgBarrePersonnalisee.setPrefWidth(imgBarrePersonnalisee.getWidth());
11755 apImgBarrePersonnalisee.setPrefHeight(imgBarrePersonnalisee.getHeight());
11756 apImgBarrePersonnalisee.setCursor(Cursor.CROSSHAIR);
11757 apImgBarrePersonnalisee.setLayoutX((iLargeur - 300 - apImgBarrePersonnalisee.getPrefWidth()) / 2.d);
11758 apImgBarrePersonnalisee.setLayoutY((iHauteur - apImgBarrePersonnalisee.getPrefHeight()) / 2.d);
11759 if ((iNombreZones > 0) && !bMasqueZones) {
11760 for (int i = 0; i < iNombreZones; i++) {
11761 ZoneTelecommande zone = zones[i];
11762 String[] strPoints = zone.getStrCoordonneesZone().split(",");
11763 double[] points = new double[strPoints.length];
11764 for (int ij = 0; ij < strPoints.length; ij++) {
11765 points[ij] = Double.parseDouble(strPoints[ij]);
11766 }
11767 final String strIdZone = zone.getStrTypeZone() + "-" + i;
11768
11769 switch (zone.getStrTypeZone()) {
11770 case "circle":
11771 Circle cercle = new Circle(points[0], points[1], points[2]);
11772 cercle.setFill(Color.rgb(255, 255, 0, 0.5));
11773 cercle.setStroke(Color.FORESTGREEN);
11774 cercle.setCursor(Cursor.DEFAULT);
11775 apImgBarrePersonnalisee.getChildren().add(cercle);
11776 cercle.setId(strIdZone);
11777 cercle.setOnMouseClicked((t) -> {
11778 choixZone(iLargeur, iHauteur, bMasqueZones, strIdZone, t);
11779 t.consume();
11780 });
11781 break;
11782 case "rect":
11783 double largRect = points[2] - points[0];
11784 double hautRect = points[3] - points[1];
11786 rect.setFill(Color.rgb(255, 255, 0, 0.5));
11787 rect.setStroke(Color.FORESTGREEN);
11788 rect.setCursor(Cursor.DEFAULT);
11789 apImgBarrePersonnalisee.getChildren().add(rect);
11790 rect.setId(strIdZone);
11791 rect.setOnMouseClicked((t) -> {
11792 choixZone(iLargeur, iHauteur, bMasqueZones, strIdZone, t);
11793 t.consume();
11794 });
11795 break;
11796 case "poly":
11797 Polygon poly = new Polygon(points);
11798 poly.setFill(Color.rgb(255, 255, 0, 0.5));
11799 poly.setStroke(Color.FORESTGREEN);
11800 poly.setStrokeWidth(3);
11801 poly.setCursor(Cursor.DEFAULT);
11802 poly.setStrokeLineCap(StrokeLineCap.ROUND);
11803 poly.setId(strIdZone);
11804 apImgBarrePersonnalisee.getChildren().add(poly);
11805 poly.setOnMouseClicked((t) -> {
11806 choixZone(iLargeur, iHauteur, bMasqueZones, strIdZone, t);
11807 t.consume();
11808 });
11809 break;
11810 }
11811 }
11812 }
11813 }
11814
11821 private static void ajouterZone(int iLargeur, int iHauteur, boolean bMasqueZones) {
11822 if (iNombreZones == -1) {
11823 iNombreZones = 0;
11824 }
11826 strTypeZone = "poly";
11827 zone.setStrTypeZone(strTypeZone);
11828 iNombrePointsZone = 0;
11829 bRecommenceZone = false;
11830 apZoneBarrePersonnalisee.getChildren().clear();
11831 apZoneBarrePersonnalisee.getStyleClass().add("dialog-content-pane");
11832
11833 // Boutons modernes avec effets hover
11834 Button btnAnnuler = new Button(rbLocalisation.getString("main.annuler"), new ImageView(new Image("file:" + getStrRepertAppli() + "/images/annule.png")));
11835 Button btnValider = new Button(rbLocalisation.getString("main.valider"), new ImageView(new Image("file:" + getStrRepertAppli() + "/images/valide.png")));
11836
11837 btnValider.setLayoutX(175);
11838 btnValider.setLayoutY(235);
11839 btnValider.setPrefWidth(140);
11840 btnValider.setPrefHeight(35);
11841
11842 btnAnnuler.setLayoutX(20);
11843 btnAnnuler.setLayoutY(235);
11844 btnAnnuler.setPrefWidth(140);
11845 btnAnnuler.setPrefHeight(35);
11846
11848
11849 // Label de section moderne
11850 Label lblTypeZone = new Label(rbLocalisation.getString("main.typeZone"));
11851 lblTypeZone.setLayoutX(20);
11852 lblTypeZone.setLayoutY(10);
11853
11854 // RadioButtons modernes avec fond blanc
11855 RadioButton rbCercleZone = new RadioButton(rbLocalisation.getString("main.cercle"));
11856 rbCercleZone.setLayoutX(20);
11857 rbCercleZone.setLayoutY(40);
11858 rbCercleZone.setUserData("circle");
11859 rbCercleZone.setToggleGroup(tgTypeZone);
11860
11861 RadioButton rbRectZone = new RadioButton(rbLocalisation.getString("main.rectangle"));
11862 rbRectZone.setLayoutX(20);
11863 rbRectZone.setLayoutY(70);
11864 rbRectZone.setUserData("rect");
11865 rbRectZone.setToggleGroup(tgTypeZone);
11866
11867 RadioButton rbPolyZone = new RadioButton(rbLocalisation.getString("main.polygone"));
11868 rbPolyZone.setLayoutX(20);
11869 rbPolyZone.setLayoutY(100);
11870 rbPolyZone.setUserData("poly");
11871 rbPolyZone.setToggleGroup(tgTypeZone);
11872 rbPolyZone.setSelected(true);
11873
11874 // Label pour la ComboBox
11875 Label lblTouche = new Label("Touche :");
11876 lblTouche.setLayoutX(20);
11877 lblTouche.setLayoutY(140);
11878
11879 // ComboBox moderne
11881 cbTouchesBarre.getItems().clear();
11882 for (int i = 0; i < strTouchesBarre.length; i++) {
11883 cbTouchesBarre.getItems().add(i, strTouchesBarre[i]);
11884 }
11885 cbTouchesBarre.setLayoutX(20);
11886 cbTouchesBarre.setLayoutY(165);
11887 cbTouchesBarre.setPrefWidth(295);
11888
11889 afficheBarrePersonnalisee(iLargeur, iHauteur, bMasqueZones);
11891 apCreeZone.setStyle("-fx-background-color : rgba(0,0,0,0.1)");
11892 apCreeZone.setPrefWidth(imgBarrePersonnalisee.getWidth());
11893 apCreeZone.setPrefHeight(imgBarrePersonnalisee.getHeight());
11894 apCreeZone.setCursor(Cursor.CROSSHAIR);
11895 apImgBarrePersonnalisee.getChildren().add(apCreeZone);
11896 apZoneBarrePersonnalisee.getChildren().addAll(
11899 lblTouche,
11901 btnAnnuler, btnValider
11902 );
11903 apCreeZone.setOnMouseClicked((t) -> {
11904 rbCercleZone.setDisable(true);
11905 rbRectZone.setDisable(true);
11906 rbPolyZone.setDisable(true);
11907 iNombrePointsZone++;
11908 switch (strTypeZone) {
11909 case "rect":
11910 if (iNombrePointsZone == 1) {
11911 apCreeZone.getChildren().clear();
11912 x1Zone = t.getX();
11913 y1Zone = t.getY();
11914 Circle cercle = new Circle(t.getX(), t.getY(), 4);
11915 cercle.setFill(Color.rgb(255, 0, 0, 0.5));
11916 cercle.setStroke(Color.YELLOW);
11917 apCreeZone.getChildren().add(cercle);
11918 }
11919 if (iNombrePointsZone == 2) {
11920 apCreeZone.getChildren().clear();
11921 Rectangle rect = new Rectangle(x1Zone, y1Zone, t.getX() - x1Zone, t.getY() - y1Zone);
11922 rect.setFill(Color.rgb(255, 0, 0, 0.5));
11923 rect.setStroke(Color.YELLOW);
11924 apCreeZone.getChildren().add(rect);
11926 = Math.round(x1Zone * 10) / 10 + "," + Math.round(y1Zone * 10) / 10 + ","
11927 + Math.round(t.getX() * 10) / 10 + "," + Math.round(t.getY() * 10) / 10;
11928 zone.setStrCoordonneesZone(chaine);
11929 iNombrePointsZone = 0;
11930 }
11931 break;
11932 case "circle":
11933 if (iNombrePointsZone == 1) {
11934 apCreeZone.getChildren().clear();
11935 x1Zone = t.getX();
11936 y1Zone = t.getY();
11937 Circle cercle = new Circle(t.getX(), t.getY(), 4);
11938 cercle.setFill(Color.rgb(255, 0, 0, 0.5));
11939 cercle.setStroke(Color.YELLOW);
11940 apCreeZone.getChildren().add(cercle);
11941 }
11942 if (iNombrePointsZone == 2) {
11943 apCreeZone.getChildren().clear();
11944 double rayon = Math.sqrt(Math.pow(x1Zone - t.getX(), 2.d) + Math.pow(y1Zone - t.getY(), 2.d));
11945 Circle cercle = new Circle(x1Zone, y1Zone, rayon);
11946 cercle.setFill(Color.rgb(255, 0, 0, 0.5));
11947 cercle.setStroke(Color.YELLOW);
11948 apCreeZone.getChildren().add(cercle);
11950 = Math.round(x1Zone * 10) / 10 + "," + Math.round(y1Zone * 10) / 10 + ","
11951 + Math.round(rayon * 10) / 10;
11952 zone.setStrCoordonneesZone(chaine);
11953 iNombrePointsZone = 0;
11954 }
11955 break;
11956 case "poly":
11957 if (bRecommenceZone) {
11958 bRecommenceZone = false;
11959 iNombrePointsZone = 1;
11960 }
11961 if (iNombrePointsZone == 1) {
11962 apCreeZone.getChildren().clear();
11963 x1Zone = t.getX();
11964 y1Zone = t.getY();
11965 Circle cercle = new Circle(t.getX(), t.getY(), 4);
11966 cercle.setFill(Color.rgb(255, 0, 0, 0.5));
11967 cercle.setStroke(Color.YELLOW);
11968 apCreeZone.getChildren().add(cercle);
11969 pointsPolyZone[(iNombrePointsZone - 1) * 2] = t.getX();
11970 pointsPolyZone[(iNombrePointsZone - 1) * 2 + 1] = t.getY();
11971 }
11972 if (iNombrePointsZone == 2) {
11973 apCreeZone.getChildren().clear();
11974 Line ligne = new Line(x1Zone, y1Zone, t.getX(), t.getY());
11975 ligne.setStroke(Color.YELLOW);
11976 apCreeZone.getChildren().add(ligne);
11977 pointsPolyZone[(iNombrePointsZone - 1) * 2] = t.getX();
11978 pointsPolyZone[(iNombrePointsZone - 1) * 2 + 1] = t.getY();
11979 }
11980 if (iNombrePointsZone > 2) {
11981 pointsPolyZone[(iNombrePointsZone - 1) * 2] = t.getX();
11982 pointsPolyZone[(iNombrePointsZone - 1) * 2 + 1] = t.getY();
11983 apCreeZone.getChildren().clear();
11984 Polygon poly = new Polygon();
11985 for (int i = 0; i < iNombrePointsZone; i++) {
11986 poly.getPoints().addAll(pointsPolyZone[i * 2], pointsPolyZone[i * 2 + 1]);
11987 }
11988 poly.setFill(Color.rgb(255, 0, 0, 0.5));
11989 poly.setStroke(Color.YELLOW);
11990 apCreeZone.getChildren().add(poly);
11991 }
11992 if (t.getClickCount() == 2) {
11993 String chaine = "";
11994 for (int i = 0; i < iNombrePointsZone; i++) {
11995 if (i != 0) {
11996 chaine += ",";
11997 }
11998 chaine += Math.round(pointsPolyZone[i * 2] * 10) / 10 + "," + Math.round(pointsPolyZone[i * 2 + 1] * 10) / 10;
11999 }
12000 zone.setStrCoordonneesZone(chaine);
12001 bRecommenceZone = true;
12002 }
12003 break;
12004 }
12005 });
12006
12007 apCreeZone.setOnMouseMoved((t) -> {
12008 switch (strTypeZone) {
12009 case "rect":
12010 if (iNombrePointsZone == 1) {
12011 apCreeZone.getChildren().clear();
12012 Rectangle rect = new Rectangle(x1Zone, y1Zone, t.getX() - x1Zone, t.getY() - y1Zone);
12013 rect.setFill(Color.rgb(255, 0, 0, 0.5));
12014 rect.setStroke(Color.YELLOW);
12015 apCreeZone.getChildren().add(rect);
12016 }
12017 break;
12018 case "circle":
12019 if (iNombrePointsZone == 1) {
12020 apCreeZone.getChildren().clear();
12021 double rayon = Math.sqrt(Math.pow(x1Zone - t.getX(), 2.d) + Math.pow(y1Zone - t.getY(), 2.d));
12022 Circle cercle = new Circle(x1Zone, y1Zone, rayon);
12023 cercle.setFill(Color.rgb(255, 0, 0, 0.5));
12024 cercle.setStroke(Color.YELLOW);
12025 apCreeZone.getChildren().add(cercle);
12026 }
12027 break;
12028 case "poly":
12029 if (!bRecommenceZone) {
12030 if (iNombrePointsZone == 1) {
12031 apCreeZone.getChildren().clear();
12032 Line ligne = new Line(x1Zone, y1Zone, t.getX(), t.getY());
12033 ligne.setStroke(Color.YELLOW);
12034 apCreeZone.getChildren().add(ligne);
12035 }
12036 if (iNombrePointsZone > 1) {
12037 apCreeZone.getChildren().clear();
12038 Polygon poly = new Polygon();
12039 for (int i = 0; i < iNombrePointsZone; i++) {
12040 poly.getPoints().addAll(pointsPolyZone[i * 2], pointsPolyZone[i * 2 + 1]);
12041 }
12042 poly.getPoints().addAll(t.getX(), t.getY());
12043 poly.setFill(Color.rgb(255, 0, 0, 0.5));
12044 poly.setStroke(Color.YELLOW);
12045 apCreeZone.getChildren().add(poly);
12046 }
12047 }
12048 break;
12049 }
12050 });
12051
12052 btnValider.setOnMouseClicked((t) -> {
12053 if (strTypeZone.equals("poly")) {
12054 String strChaine = "";
12055 for (int i = 0; i < iNombrePointsZone; i++) {
12056 if (i != 0) {
12057 strChaine += ",";
12058 }
12059 strChaine += Math.round(pointsPolyZone[i * 2] * 10) / 10 + "," + Math.round(pointsPolyZone[i * 2 + 1] * 10) / 10;
12060 }
12061 zone.setStrCoordonneesZone(strChaine);
12062
12063 }
12064 zones[iNombreZones] = zone;
12065 iNombreZones++;
12066 afficheBarrePersonnalisee(iLargeur, iHauteur, bMasqueZones);
12067 btnAjouteZone.setDisable(false);
12068 });
12069
12070 btnAnnuler.setOnMouseClicked((t) -> {
12071 afficheBarrePersonnalisee(iLargeur, iHauteur, bMasqueZones);
12072 btnAjouteZone.setDisable(false);
12073 });
12074
12075 cbTouchesBarre.valueProperty().addListener((ov, strAncienneValeur, strNouvelleValeur) -> {
12076 if (strNouvelleValeur != null) {
12077 String strId = strCodeBarre[cbTouchesBarre.getSelectionModel().getSelectedIndex()];
12078 zone.setStrIdZone(strId);
12079 }
12080 });
12081
12082 tgTypeZone.selectedToggleProperty().addListener((ObservableValue<? extends Toggle> ov, Toggle old_toggle, Toggle new_toggle) -> {
12083 if (tgTypeZone.getSelectedToggle() != null) {
12084 strTypeZone = tgTypeZone.getSelectedToggle().getUserData().toString();
12085 zone.setStrTypeZone(strTypeZone);
12086 }
12087 });
12088
12089 }
12090
12097 @SuppressWarnings("null")
12100 try {
12101 String strZones = "";
12102 for (int i = 0; i < iNombreZones; i++) {
12103 ZoneTelecommande zone = zones[i];
12104 strZones += "[area=>id:" + zone.getStrIdZone() + ";";
12105 strZones += "shape:" + zone.getStrTypeZone() + ";";
12106 strZones += "coords:" + zone.getStrCoordonneesZone() + "]\n";
12107 }
12109 if (!fileIndexHTML.exists()) {
12110 fileIndexHTML.createNewFile();
12111 }
12112 fileIndexHTML.setWritable(true);
12115 bwFichierBarre.write(strZones);
12116
12117 }
12119 Logger.getLogger(EditeurPanovisu.class
12120 .getName()).log(Level.SEVERE, null, ex);
12121 } finally {
12122 try {
12123 oswFichierBarre.close();
12124
12125 } catch (IOException ex) {
12126 Logger.getLogger(EditeurPanovisu.class
12127 .getName()).log(Level.SEVERE, null, ex);
12128 }
12129 }
12130 }
12131
12132 private static void creeDiaporamaHTML(Diaporama diapo, int iNumero) throws IOException {
12133 String strDiapoRepert = getStrRepertTemp() + "/diaporama";
12135 if (!fileDiapoRepert.exists()) {
12136 fileDiapoRepert.mkdirs();
12137 copieRepertoire(getStrRepertAppli() + File.separator + "diaporama", fileDiapoRepert.getAbsolutePath());
12138 }
12139 String strImageDiapoRepert = getStrRepertTemp() + "/diaporama/images";
12141 if (!fileImagesDiapoRepert.exists()) {
12142 fileImagesDiapoRepert.mkdirs();
12143 }
12144 String strVignetteDiapoRepert = getStrRepertTemp() + "/diaporama/vignettes";
12146 if (!fileVignetteDiapoRepert.exists()) {
12147 fileVignetteDiapoRepert.mkdirs();
12148 }
12149 for (int i = 0; i < diapo.getiNombreImages(); i++) {
12150 copieFichierRepertoire(diapo.getStrFichiersImage(i), strImageDiapoRepert);
12151
12152 // Vérifier que le fichier source existe avant de créer l'image
12153 File fichierSource = new File(diapo.getStrFichiersImage(i));
12154 if (!fichierSource.exists()) {
12155 System.err.println("⚠️ Fichier image introuvable, vignette ignorée : " + diapo.getStrFichiersImage(i));
12156 continue;
12157 }
12158
12159 Image img = new Image("file:" + diapo.getStrFichiersImage(i), 400, 300, true, true);
12160
12161 // Vérifier que l'image a été correctement chargée
12162 if (img.isError() || img.getWidth() == 0 || img.getHeight() == 0) {
12163 System.err.println("⚠️ Erreur de chargement de l'image, vignette ignorée : " + diapo.getStrFichiersImage(i));
12164 continue;
12165 }
12166
12167 ReadWriteImage.writeJpeg(img, fileVignetteDiapoRepert + File.separator + diapo.getStrFichiers(i), 0.75f, false, 0);
12168
12169 }
12170 String strDiapoNom = "diapo" + iNumero + ".html";
12171 int intervalle = (int) (diapo.getDelaiDiaporama() * 1000);
12172
12173 // Générer le contenu HTML moderne
12174 String strContenuHTML = "<!DOCTYPE html>\n"
12175 + "<html lang=\"fr\">\n"
12176 + "<head>\n"
12177 + " <meta charset=\"UTF-8\">\n"
12178 + " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n"
12179 + " <title>Diaporama - PanoVisu</title>\n"
12180 + " <style>\n"
12181 + " * { margin: 0; padding: 0; box-sizing: border-box; }\n"
12182 + " body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; overflow: hidden; background: #000; }\n"
12183 + " #slideshow-container { position: relative; width: 100vw; height: 100vh; background: #000; }\n"
12184 + " .slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s cubic-bezier(0.4, 0.0, 0.2, 1); z-index: 1; }\n"
12185 + " .slide.active { opacity: 1; z-index: 2; }\n"
12186 + " .slide img { width: 100%; height: 100%; object-fit: contain; background: " + diapo.getStrCouleurFondDiaporama() + "; }\n"
12187 + " #controls-bar { position: fixed; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%); padding: 30px 40px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; z-index: 100; opacity: 0; transform: translateY(100%); transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1); }\n"
12188 + " #controls-bar.visible { opacity: 1; transform: translateY(0); }\n"
12189 + " .control-button { background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; backdrop-filter: blur(10px); }\n"
12190 + " .control-button:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.6); transform: scale(1.1); }\n"
12191 + " .control-button:active { transform: scale(0.95); }\n"
12192 + " .control-button svg { width: 24px; height: 24px; fill: white; }\n"
12193 + " #play-pause-btn { width: 60px; height: 60px; }\n"
12194 + " #play-pause-btn svg { width: 28px; height: 28px; }\n"
12195 + " #progress-container { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.2); border-radius: 3px; overflow: hidden; cursor: pointer; position: relative; }\n"
12196 + " #progress-bar { height: 100%; background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%); border-radius: 3px; width: 0%; transition: width 0.1s linear; box-shadow: 0 0 10px rgba(52, 152, 219, 0.5); }\n"
12197 + " #slide-counter { color: white; font-size: 16px; font-weight: 600; min-width: 80px; text-align: center; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }\n"
12198 + " #slide-title { position: fixed; top: 30px; left: 50%; transform: translateX(-50%); color: white; font-size: 24px; font-weight: 600; text-align: center; text-shadow: 0 2px 10px rgba(0,0,0,0.8); z-index: 99; opacity: 0; transition: opacity 0.4s ease; max-width: 80%; }\n"
12199 + " #slide-title.visible { opacity: 1; }\n"
12200 + " .nav-arrow { position: fixed; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 50%; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 98; opacity: 0; transition: all 0.3s ease; backdrop-filter: blur(10px); }\n"
12201 + " .nav-arrow.visible { opacity: 1; }\n"
12202 + " .nav-arrow:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.6); transform: translateY(-50%) scale(1.1); }\n"
12203 + " .nav-arrow:active { transform: translateY(-50%) scale(0.95); }\n"
12204 + " #prev-arrow { left: 30px; }\n"
12205 + " #next-arrow { right: 30px; }\n"
12206 + " .nav-arrow svg { width: 28px; height: 28px; fill: white; }\n"
12207 + " #thumbnails-container { position: fixed; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 100%); padding: 20px; display: flex; gap: 15px; overflow-x: auto; overflow-y: hidden; z-index: 101; max-height: 150px; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1); }\n"
12208 + " #thumbnails-container.visible { transform: translateY(0); }\n"
12209 + " #thumbnails-container::-webkit-scrollbar { height: 8px; }\n"
12210 + " #thumbnails-container::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }\n"
12211 + " #thumbnails-container::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 4px; }\n"
12212 + " #thumbnails-container::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); }\n"
12213 + " .thumbnail { flex-shrink: 0; width: 120px; height: 80px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 3px solid transparent; transition: all 0.3s ease; position: relative; }\n"
12214 + " .thumbnail:hover { transform: translateY(-5px); box-shadow: 0 5px 20px rgba(0,0,0,0.5); }\n"
12215 + " .thumbnail.active { border-color: #3498db; box-shadow: 0 0 20px rgba(52, 152, 219, 0.6); }\n"
12216 + " .thumbnail img { width: 100%; height: 100%; object-fit: cover; }\n"
12217 + " .thumbnail-number { position: absolute; top: 5px; left: 5px; background: rgba(0,0,0,0.7); color: white; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; }\n"
12218 + " #toggle-thumbnails { position: fixed; bottom: 20px; right: 20px; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 102; transition: all 0.3s ease; backdrop-filter: blur(10px); }\n"
12219 + " #toggle-thumbnails:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.6); transform: scale(1.1); }\n"
12220 + " #toggle-thumbnails svg { width: 24px; height: 24px; fill: white; }\n"
12221 + " #fullscreen-btn { position: fixed; top: 20px; right: 20px; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 102; transition: all 0.3s ease; backdrop-filter: blur(10px); opacity: 0; }\n"
12222 + " #fullscreen-btn.visible { opacity: 1; }\n"
12223 + " #fullscreen-btn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.6); transform: scale(1.1); }\n"
12224 + " #fullscreen-btn svg { width: 24px; height: 24px; fill: white; }\n"
12225 + " #dots-container { position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 97; opacity: 0; transition: opacity 0.4s ease; }\n"
12226 + " #dots-container.visible { opacity: 1; }\n"
12227 + " .dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); cursor: pointer; transition: all 0.3s ease; }\n"
12228 + " .dot:hover { background: rgba(255, 255, 255, 0.6); transform: scale(1.2); }\n"
12229 + " .dot.active { background: white; box-shadow: 0 0 10px rgba(255, 255, 255, 0.8); }\n"
12230 + " @keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }\n"
12231 + " .slide.active img { animation: zoomIn 1.2s ease-out; }\n"
12232 + " </style>\n"
12233 + "</head>\n"
12234 + "<body>\n"
12235 + " <div id=\"slideshow-container\"></div>\n"
12236 + " <div id=\"slide-title\"></div>\n"
12237 + " <div id=\"prev-arrow\" class=\"nav-arrow\"><svg viewBox=\"0 0 24 24\"><path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/></svg></div>\n"
12238 + " <div id=\"next-arrow\" class=\"nav-arrow\"><svg viewBox=\"0 0 24 24\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/></svg></div>\n"
12239 + " <div id=\"controls-bar\">\n"
12240 + " <div id=\"prev-btn\" class=\"control-button\" title=\"Précédent\"><svg viewBox=\"0 0 24 24\"><path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/></svg></div>\n"
12241 + " <div id=\"play-pause-btn\" class=\"control-button\" title=\"Lecture/Pause\">\n"
12242 + " <svg id=\"play-icon\" viewBox=\"0 0 24 24\" style=\"display:none;\"><path d=\"M8 5v14l11-7z\"/></svg>\n"
12243 + " <svg id=\"pause-icon\" viewBox=\"0 0 24 24\"><path d=\"M6 19h4V5H6v14zm8-14v14h4V5h-4z\"/></svg>\n"
12244 + " </div>\n"
12245 + " <div id=\"next-btn\" class=\"control-button\" title=\"Suivant\"><svg viewBox=\"0 0 24 24\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/></svg></div>\n"
12246 + " <div id=\"progress-container\"><div id=\"progress-bar\"></div></div>\n"
12247 + " <div id=\"slide-counter\"><span id=\"current-slide\">1</span> / <span id=\"total-slides\">0</span></div>\n"
12248 + " </div>\n"
12249 + " <div id=\"dots-container\"></div>\n"
12250 + " <div id=\"fullscreen-btn\" title=\"Plein écran\"><svg viewBox=\"0 0 24 24\"><path d=\"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z\"/></svg></div>\n"
12251 + " <div id=\"toggle-thumbnails\" title=\"Afficher/Masquer les miniatures\"><svg viewBox=\"0 0 24 24\"><path d=\"M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z\"/></svg></div>\n"
12252 + " <div id=\"thumbnails-container\"></div>\n"
12253 + " <script>\n"
12254 + " const slideshowConfig = {\n"
12255 + " slides: [\n";
12256
12257 // Ajouter les images du diaporama
12258 for (int i = 0; i < diapo.getiNombreImages(); i++) {
12259 String titre = diapo.getStrLibellesImages(i)
12260 .replace("\\", "\\\\")
12261 .replace("\"", "\\\"")
12262 .replace("\n", "\\n")
12263 .replace("\r", "");
12264 strContenuHTML += " {image: 'images/" + diapo.getStrFichiers(i) + "', "
12265 + "title: \"" + titre + "\", "
12266 + "thumb: 'vignettes/" + diapo.getStrFichiers(i) + "'}";
12267 if (i < diapo.getiNombreImages() - 1) {
12268 strContenuHTML += ",\n";
12269 } else {
12270 strContenuHTML += "\n";
12271 }
12272 }
12273
12274 strContenuHTML += " ],\n"
12275 + " interval: " + intervalle + ",\n"
12276 + " autoplay: true,\n"
12277 + " transition: 'fade',\n"
12278 + " transitionSpeed: 1200\n"
12279 + " };\n"
12280 + " let currentSlide = 0, isPlaying = true, slideTimer = null, progressTimer = null, controlsTimeout = null, thumbnailsVisible = false;\n"
12281 + " function init() { createSlides(); createThumbnails(); createDots(); showSlide(0); setupEventListeners(); showControls(); if (slideshowConfig.autoplay) startSlideshow(); }\n"
12282 + " function createSlides() { const container = document.getElementById('slideshow-container'); slideshowConfig.slides.forEach((slide, index) => { const slideDiv = document.createElement('div'); slideDiv.className = 'slide'; slideDiv.dataset.index = index; const img = document.createElement('img'); img.src = slide.image; img.alt = slide.title || ''; slideDiv.appendChild(img); container.appendChild(slideDiv); }); document.getElementById('total-slides').textContent = slideshowConfig.slides.length; }\n"
12283 + " function createThumbnails() { const container = document.getElementById('thumbnails-container'); slideshowConfig.slides.forEach((slide, index) => { const thumb = document.createElement('div'); thumb.className = 'thumbnail'; thumb.dataset.index = index; thumb.onclick = () => goToSlide(index); const img = document.createElement('img'); img.src = slide.thumb || slide.image; img.alt = slide.title || ''; const number = document.createElement('div'); number.className = 'thumbnail-number'; number.textContent = index + 1; thumb.appendChild(img); thumb.appendChild(number); container.appendChild(thumb); }); }\n"
12284 + " function createDots() { const container = document.getElementById('dots-container'); slideshowConfig.slides.forEach((slide, index) => { const dot = document.createElement('div'); dot.className = 'dot'; dot.dataset.index = index; dot.onclick = () => goToSlide(index); container.appendChild(dot); }); }\n"
12285 + " function showSlide(index) { if (index < 0) index = slideshowConfig.slides.length - 1; if (index >= slideshowConfig.slides.length) index = 0; currentSlide = index; document.querySelectorAll('.slide').forEach(slide => slide.classList.remove('active')); document.querySelector(`.slide[data-index=\"${index}\"]`).classList.add('active'); document.querySelectorAll('.thumbnail').forEach(thumb => thumb.classList.remove('active')); const activeThumb = document.querySelector(`.thumbnail[data-index=\"${index}\"]`); activeThumb.classList.add('active'); activeThumb.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' }); document.querySelectorAll('.dot').forEach(dot => dot.classList.remove('active')); document.querySelector(`.dot[data-index=\"${index}\"]`)?.classList.add('active'); const title = slideshowConfig.slides[index].title; const titleElement = document.getElementById('slide-title'); if (title) { titleElement.textContent = title; titleElement.classList.add('visible'); } else { titleElement.classList.remove('visible'); } document.getElementById('current-slide').textContent = index + 1; resetProgress(); }\n"
12286 + " function nextSlide() { showSlide(currentSlide + 1); }\n"
12287 + " function prevSlide() { showSlide(currentSlide - 1); }\n"
12288 + " function goToSlide(index) { const wasPlaying = isPlaying; stopSlideshow(); showSlide(index); if (wasPlaying) startSlideshow(); }\n"
12289 + " function startSlideshow() { if (slideTimer) clearInterval(slideTimer); if (progressTimer) clearInterval(progressTimer); isPlaying = true; updatePlayPauseButton(); slideTimer = setInterval(nextSlide, slideshowConfig.interval); startProgress(); }\n"
12290 + " function stopSlideshow() { if (slideTimer) clearInterval(slideTimer); if (progressTimer) clearInterval(progressTimer); isPlaying = false; updatePlayPauseButton(); }\n"
12291 + " function togglePlayPause() { if (isPlaying) stopSlideshow(); else startSlideshow(); }\n"
12292 + " function updatePlayPauseButton() { document.getElementById('play-icon').style.display = isPlaying ? 'none' : 'block'; document.getElementById('pause-icon').style.display = isPlaying ? 'block' : 'none'; }\n"
12293 + " function startProgress() { let progress = 0; const progressBar = document.getElementById('progress-bar'); const increment = 100 / (slideshowConfig.interval / 100); progressTimer = setInterval(() => { progress += increment; if (progress >= 100) progress = 100; progressBar.style.width = progress + '%'; }, 100); }\n"
12294 + " function resetProgress() { if (progressTimer) clearInterval(progressTimer); document.getElementById('progress-bar').style.width = '0%'; if (isPlaying) startProgress(); }\n"
12295 + " function showControls() { document.getElementById('controls-bar').classList.add('visible'); document.getElementById('prev-arrow').classList.add('visible'); document.getElementById('next-arrow').classList.add('visible'); document.getElementById('fullscreen-btn').classList.add('visible'); document.getElementById('dots-container').classList.add('visible'); if (controlsTimeout) clearTimeout(controlsTimeout); controlsTimeout = setTimeout(hideControls, 3000); }\n"
12296 + " function hideControls() { if (!thumbnailsVisible) { document.getElementById('controls-bar').classList.remove('visible'); document.getElementById('prev-arrow').classList.remove('visible'); document.getElementById('next-arrow').classList.remove('visible'); document.getElementById('fullscreen-btn').classList.remove('visible'); document.getElementById('dots-container').classList.remove('visible'); } }\n"
12297 + " function toggleThumbnails() { thumbnailsVisible = !thumbnailsVisible; const container = document.getElementById('thumbnails-container'); if (thumbnailsVisible) { container.classList.add('visible'); showControls(); } else { container.classList.remove('visible'); } }\n"
12298 + " function toggleFullscreen() { if (!document.fullscreenElement) document.documentElement.requestFullscreen(); else document.exitFullscreen(); }\n"
12299 + " function manualPrevSlide() { const wasPlaying = isPlaying; stopSlideshow(); prevSlide(); if (wasPlaying) startSlideshow(); }\n"
12300 + " function manualNextSlide() { const wasPlaying = isPlaying; stopSlideshow(); nextSlide(); if (wasPlaying) startSlideshow(); }\n"
12301 + " function setupEventListeners() { document.getElementById('prev-btn').onclick = manualPrevSlide; document.getElementById('next-btn').onclick = manualNextSlide; document.getElementById('play-pause-btn').onclick = togglePlayPause; document.getElementById('prev-arrow').onclick = manualPrevSlide; document.getElementById('next-arrow').onclick = manualNextSlide; document.getElementById('toggle-thumbnails').onclick = toggleThumbnails; document.getElementById('fullscreen-btn').onclick = toggleFullscreen; document.getElementById('progress-container').onclick = (e) => { const rect = e.currentTarget.getBoundingClientRect(); const percent = (e.clientX - rect.left) / rect.width; const slideIndex = Math.floor(percent * slideshowConfig.slides.length); goToSlide(slideIndex); }; document.addEventListener('keydown', (e) => { if (e.key === 'ArrowLeft') { manualPrevSlide(); } else if (e.key === 'ArrowRight') { manualNextSlide(); } else if (e.key === ' ') { e.preventDefault(); togglePlayPause(); } else if (e.key === 'Escape') { if (document.fullscreenElement) document.exitFullscreen(); } else if (e.key === 'f' || e.key === 'F') { toggleFullscreen(); } }); document.addEventListener('mousemove', showControls); document.addEventListener('touchstart', showControls); }\n"
12302 + " window.addEventListener('load', init);\n"
12303 + " </script>\n"
12304 + "</body>\n"
12305 + "</html>";
12307 fileIndexHTML.setWritable(true);
12311 }
12312
12313 }
12314
12315 static final WebView browser = new WebView();
12316 static final WebEngine webEngine = browser.getEngine();
12317
12319 apCreationDiaporama.getChildren().clear();
12320 apCreationDiaporama.getStyleClass().add("dialog-content-pane");
12321 mbarPrincipal.setDisable(true);
12322 bbarPrincipal.setDisable(true);
12323 hbBarreBouton.setDisable(true);
12324 tpEnvironnement.setDisable(true);
12325
12326 Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
12327 int iLargeurEcran = (int) tailleEcran.getWidth();
12328 int iHauteurEcran = (int) tailleEcran.getHeight() - 100;
12329 final int iLargeur = 900;
12330 final int iHauteur = 720;
12331 Label lblNomDiapo = new Label(rbLocalisation.getString("main.nomDiapo"));
12332 lblNomDiapo.setLayoutX(30);
12333 lblNomDiapo.setLayoutY(45);
12334
12336 cbListeDiapo.setLayoutX(150);
12337 cbListeDiapo.setLayoutY(40);
12338 cbListeDiapo.setValue("");
12339 for (int i = 0; i < getiNombreDiapo(); i++) {
12340 cbListeDiapo.getItems().add(diaporamas[i].getStrNomDiaporama());
12341 }
12342
12343 Button btnNouveauDiapo = new Button(rbLocalisation.getString("diapo.nouveau"));
12344 btnNouveauDiapo.setLayoutX(iLargeur - 330);
12345 btnNouveauDiapo.setLayoutY(20);
12346 btnNouveauDiapo.setPrefSize(140, 60);
12347
12348 Button btnEffaceDiapo = new Button(rbLocalisation.getString("diapo.efface"));
12349 btnEffaceDiapo.setLayoutX(iLargeur - 170);
12350 btnEffaceDiapo.setLayoutY(20);
12351 btnEffaceDiapo.setPrefSize(140, 60);
12352
12353 gestDiapo = new GestionnaireDiaporamaController();
12354 gestDiapo.initDiaporama();
12355 apCreationDiaporama.getChildren().addAll(
12358 gestDiapo.apDiaporama
12359 );
12360
12361 apCreationDiaporama.setPrefWidth(iLargeur);
12362 //apCreationDiaporama.setMinWidth(iLargeur);
12363 apCreationDiaporama.setMaxWidth(iLargeur);
12364 apCreationDiaporama.setPrefHeight(iHauteur);
12365 //apCreationDiaporama.setMinHeight(iHauteur);
12366 apCreationDiaporama.setMaxHeight(iHauteur);
12367 apCreationDiaporama.setLayoutX((iLargeurEcran - iLargeur) / 2);
12368 apCreationDiaporama.setLayoutY((iHauteurEcran - iHauteur) / 2);
12369 apCreationDiaporama.setVisible(true);
12370
12371 gestDiapo.addPropertyChangeListener("valideDiapo", (e) -> {
12372 mbarPrincipal.setDisable(false);
12373 bbarPrincipal.setDisable(false);
12374 hbBarreBouton.setDisable(false);
12375 tpEnvironnement.setDisable(false);
12376 apCreationDiaporama.setVisible(false);
12377 gestDiapo.diapoSauve = true;
12378 boolean bTrouve = false;
12379 int iTrouve = -1;
12380 for (int i = 0; i < getiNombreDiapo(); i++) {
12381 if (diaporamas[i].getStrNomDiaporama().equals(cbListeDiapo.getValue())) {
12382 bTrouve = true;
12383 iTrouve = i;
12384 }
12385 }
12386 if (bTrouve) {
12387 diaporamas[iTrouve] = gestDiapo.getDiaporama();
12388 try {
12389 creeDiaporamaHTML(diaporamas[iTrouve], iTrouve);
12390 } catch (IOException ex) {
12391 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
12392 }
12393 }
12394 gestDiapo.reInit(new Diaporama());
12395 });
12396
12397 gestDiapo.addPropertyChangeListener("visualiseDiapo", (e) -> {
12398 try {
12399 creeDiaporamaHTML(gestDiapo.getDiaporama(), -1);
12400 } catch (IOException ex) {
12401 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
12402 }
12403 String strNomFichier = getStrRepertTemp()
12404 + File.separator + "diaporama"
12405 + File.separator + "diapo-1.html";
12406 webEngine.load("file:///" + strNomFichier);
12407 apWebview.getChildren().clear();
12408 browser.setPrefSize(apWebview.getPrefWidth() - 20, apWebview.getPrefHeight() - 50);
12409 browser.setTranslateX(10);
12410 browser.setTranslateY(10);
12411 apWebview.getChildren().add(browser);
12412 Button btnOk = new Button("Ok");
12413 btnOk.setPrefSize(100, 20);
12414 btnOk.setLayoutX(apWebview.getPrefWidth() - 110);
12415 btnOk.setLayoutY(apWebview.getPrefHeight() - 30);
12416 apWebview.getChildren().add(btnOk);
12417 apWebview.setVisible(true);
12418 btnOk.setOnMouseClicked((me) -> {
12419 apWebview.setVisible(false);
12420 apWebview.getChildren().clear();
12421 });
12422 });
12423
12424 gestDiapo.addPropertyChangeListener("annuleDiapo", (e) -> {
12425 mbarPrincipal.setDisable(false);
12426 bbarPrincipal.setDisable(false);
12427 hbBarreBouton.setDisable(false);
12428 tpEnvironnement.setDisable(false);
12429 apCreationDiaporama.setVisible(false);
12430 gestDiapo.diapoSauve = true;
12431 gestDiapo.reInit(new Diaporama());
12432 });
12433
12434 cbListeDiapo.valueProperty().addListener((ov, old_val, new_val) -> {
12435 if (new_val != null) {
12436 ButtonType reponse = null;
12437 ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
12438 ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
12439 if (!gestDiapo.diapoSauve) {
12440 Alert alert = new Alert(AlertType.CONFIRMATION);
12441 alert.setTitle(rbLocalisation.getString("diapo.sauver"));
12442 alert.setHeaderText(null);
12443 alert.setContentText(rbLocalisation.getString("diapo.sauverTexte"));
12444 alert.getButtonTypes().clear();
12445 alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon);
12446 Optional<ButtonType> actReponse = alert.showAndWait();
12447 reponse = actReponse.get();
12448 }
12449 if (reponse == buttonTypeOui) {
12450
12451 boolean bTrouve = false;
12452 int iTrouve = -1;
12453 for (int i = 0; i < getiNombreDiapo(); i++) {
12454 if (diaporamas[i].getStrNomDiaporama().equals(old_val)) {
12455 bTrouve = true;
12456 iTrouve = i;
12457 }
12458 }
12459 if (bTrouve) {
12460 diaporamas[iTrouve] = gestDiapo.getDiaporama();
12461 try {
12462 creeDiaporamaHTML(diaporamas[iTrouve], iTrouve);
12463 } catch (IOException ex) {
12464 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
12465 }
12466 }
12467
12468 }
12469 gestDiapo.diapoSauve = true;
12470 boolean bTrouve = false;
12471 int iTrouve = -1;
12472 for (int i = 0; i < getiNombreDiapo(); i++) {
12473 if (diaporamas[i].getStrNomDiaporama().equals(new_val)) {
12474 bTrouve = true;
12475 iTrouve = i;
12476 }
12477 }
12478 if (bTrouve) {
12479 gestDiapo.setbDisabled(false);
12480 gestDiapo.reInit(diaporamas[iTrouve]);
12481
12482 }
12483
12484 }
12485 });
12486
12487 btnNouveauDiapo.setOnMouseClicked((me) -> {
12488 ButtonType reponse = null;
12489 ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
12490 ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
12491 if (!gestDiapo.diapoSauve) {
12492 Alert alert = new Alert(AlertType.CONFIRMATION);
12493 alert.setTitle(rbLocalisation.getString("diapo.sauver"));
12494 alert.setHeaderText(null);
12495 alert.setContentText(rbLocalisation.getString("diapo.sauverTexte"));
12496 alert.getButtonTypes().clear();
12497 alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon);
12498 Optional<ButtonType> actReponse = alert.showAndWait();
12499 reponse = actReponse.get();
12500 }
12501 if (reponse == buttonTypeOui) {
12502 gestDiapo.diapoSauve = true;
12503 boolean bTrouve = false;
12504 int iTrouve = -1;
12505 for (int i = 0; i < getiNombreDiapo(); i++) {
12506 if (diaporamas[i].getStrNomDiaporama().equals(cbListeDiapo.getValue())) {
12507 bTrouve = true;
12508 iTrouve = i;
12509 }
12510 }
12511 if (bTrouve) {
12512 diaporamas[iTrouve] = gestDiapo.getDiaporama();
12513 try {
12514 creeDiaporamaHTML(diaporamas[iTrouve], iTrouve);
12515 } catch (IOException ex) {
12516 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
12517 }
12518 }
12519
12520 }
12521
12523 dialog.setTitle(rbLocalisation.getString("main.nomDiapo"));
12524 dialog.setHeaderText(null);
12525 dialog.setContentText(rbLocalisation.getString("diapo.entrerNom"));
12526
12527 Optional<String> resultat = dialog.showAndWait();
12528 if (resultat.isPresent()) {
12529 String nomDiapo = resultat.get();
12530 boolean bTrouve = false;
12531 for (int i = 0; i < getiNombreDiapo(); i++) {
12532 if (diaporamas[i].getStrNomDiaporama().equals(nomDiapo)) {
12533 bTrouve = true;
12534 }
12535 }
12536 if (!bTrouve) {
12537 diaporamas[getiNombreDiapo()] = new Diaporama();
12538 diaporamas[getiNombreDiapo()].setStrNomDiaporama(nomDiapo);
12539 cbListeDiapo.getItems().add(nomDiapo);
12540 cbListeDiapo.setValue(nomDiapo);
12541 gestDiapo.setbDisabled(false);
12542 gestDiapo.reInit(diaporamas[getiNombreDiapo()]);
12543 setiNombreDiapo(getiNombreDiapo() + 1);
12544
12545 } else {
12546 Alert alert = new Alert(AlertType.ERROR);
12547 alert.setTitle(rbLocalisation.getString("diapo.erreur"));
12548 alert.setHeaderText(null);
12549 alert.setContentText(rbLocalisation.getString("diapo.erreurNom"));
12550 alert.showAndWait();
12551
12552 }
12553 }
12554 }
12555 );
12556
12557 }
12558
12564 apCreationBarre.getChildren().clear();
12565 apCreationBarre.getStyleClass().add("dialog-content-pane");
12566
12567 // Style moderne avec fond gris clair et padding
12568
12570 apOutilsBarre.getStyleClass().add("dialog-content-pane");
12571 Button btnAnnulerBarre = new Button(rbLocalisation.getString("main.quitter"), new ImageView(new Image("file:" + getStrRepertAppli() + "/images/annule.png")));
12572 final Button btnSauverBarre = new Button(rbLocalisation.getString("main.sauver"), new ImageView(new Image("file:" + getStrRepertAppli() + "/images/sauveProjet.png", 24, 24, true, true, true)));
12573 Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
12574 btnAjouteZone = new Button(rbLocalisation.getString("main.ajouteZone"), new ImageView(new Image("file:" + getStrRepertAppli() + "/images/btn+.png", 24, 24, true, true, true)));
12575 apImgBarrePersonnalisee = new AnchorPane();
12576 apImgBarrePersonnalisee.getChildren().clear();
12577 apZoneBarrePersonnalisee = new AnchorPane();
12578 apZoneBarrePersonnalisee.getChildren().clear();
12579 apZoneBarrePersonnalisee.setLayoutX(0);
12580 apZoneBarrePersonnalisee.setLayoutY(180);
12581 apZoneBarrePersonnalisee.setPrefWidth(330);
12582 apZoneBarrePersonnalisee.setPrefHeight(280);
12583
12584 int iLargeurEcran = (int) tailleEcran.getWidth();
12585 int iHauteurEcran = (int) tailleEcran.getHeight() - 100;
12586 final int iLargeur = 1300;
12587 final int iHauteur = 700;
12588 mbarPrincipal.setDisable(true);
12589 bbarPrincipal.setDisable(true);
12590 hbBarreBouton.setDisable(true);
12591 tpEnvironnement.setDisable(true);
12592 apCreationBarre.setPrefWidth(iLargeur);
12593 apCreationBarre.setMinWidth(iLargeur);
12594 apCreationBarre.setMaxWidth(iLargeur);
12595 apCreationBarre.setPrefHeight(iHauteur);
12596 apCreationBarre.setMinHeight(iHauteur);
12597 apCreationBarre.setMaxHeight(iHauteur);
12598 apCreationBarre.setLayoutX((iLargeurEcran - iLargeur) / 2);
12599 apCreationBarre.setLayoutY((iHauteurEcran - iHauteur) / 2);
12600 apCreationBarre.setVisible(true);
12601
12602 // Titre moderne
12603 Label lblBarrePersonnalisee = new Label(rbLocalisation.getString("main.creeBarrePersonnalisee"));
12604 lblBarrePersonnalisee.setMinWidth(iLargeur - 40);
12605 lblBarrePersonnalisee.setAlignment(Pos.CENTER);
12606 lblBarrePersonnalisee.setLayoutX(20);
12607 lblBarrePersonnalisee.setLayoutY(10);
12608 apCreationBarre.getChildren().add(lblBarrePersonnalisee);
12609
12610 // Panel d'outils à droite avec style moderne
12611 apOutilsBarre.setPrefWidth(350);
12612 apOutilsBarre.setMinWidth(350);
12613 apOutilsBarre.setMaxWidth(350);
12614 apOutilsBarre.setPrefHeight(iHauteur - 100);
12615 apOutilsBarre.setMinHeight(iHauteur - 100);
12616 apOutilsBarre.setMaxHeight(iHauteur - 100);
12617 apOutilsBarre.setLayoutX(iLargeur - 370);
12618 apOutilsBarre.setLayoutY(70);
12619 apOutilsBarre.setPadding(new Insets(15, 15, 20, 15)); // Padding: top, right, bottom, left
12620
12621 // Titre de section "Outils"
12622 Label lblTitreOutils = new Label("Outils");
12623 lblTitreOutils.setLayoutX(20);
12624 lblTitreOutils.setLayoutY(15);
12625
12626 // Label et champ de chargement d'image
12627 Label lblChargeImage = new Label(rbLocalisation.getString("main.chargeImage"));
12628 lblChargeImage.setLayoutX(20);
12629 lblChargeImage.setLayoutY(50);
12630
12631 TextField tfChargeImage = new TextField("");
12632 tfChargeImage.setDisable(true);
12633 tfChargeImage.setPrefWidth(240);
12634 tfChargeImage.setLayoutX(20);
12635 tfChargeImage.setLayoutY(75);
12636 tfChargeImage.getStyleClass().add("text-field");
12637
12638 Button btnChargeImage = new Button("📁");
12639 btnChargeImage.setLayoutX(270);
12640 btnChargeImage.setLayoutY(75);
12641 btnChargeImage.setPrefWidth(50);
12642 btnChargeImage.getStyleClass().add("button-icon");
12643
12644
12645 // CheckBox pour masquer les zones
12646 final CheckBox cbMasqueZones = new CheckBox(rbLocalisation.getString("main.masqueZones"));
12647 cbMasqueZones.setDisable(true);
12648 cbMasqueZones.setLayoutX(20);
12649 cbMasqueZones.setLayoutY(115);
12650
12651 // Bouton Ajouter Zone
12652 btnAjouteZone.setLayoutX(20);
12653 btnAjouteZone.setLayoutY(145);
12654 btnAjouteZone.setPrefWidth(300);
12655 btnAjouteZone.setPrefHeight(35);
12656 btnAjouteZone.setDisable(true);
12657
12658 // Style des boutons Annuler et Sauver
12659 btnAnnulerBarre.setPrefWidth(150);
12660 btnAnnulerBarre.setPrefHeight(40);
12661 btnAnnulerBarre.setLayoutX(20);
12662 btnAnnulerBarre.setLayoutY((iHauteur - 100) - 60); // Position depuis le bas du panel
12663
12664 btnSauverBarre.setPrefWidth(150);
12665 btnSauverBarre.setPrefHeight(40);
12666 btnSauverBarre.setLayoutX(180);
12667 btnSauverBarre.setLayoutY((iHauteur - 100) - 60); // Position depuis le bas du panel
12668 btnSauverBarre.setDisable(true);
12669
12670 apOutilsBarre.getChildren().addAll(
12675 btnAjouteZone,
12676 apZoneBarrePersonnalisee,
12678 );
12679
12680 apCreationBarre.getChildren().addAll(apImgBarrePersonnalisee, apOutilsBarre);
12681 if (!strNomFichierBarre.equals("")) {
12682 lblChargeImage.setVisible(false);
12683 tfChargeImage.setVisible(false);
12684 btnChargeImage.setVisible(false);
12685 String strNomFichier = strNomFichierBarre;
12686 strNomFichier = strNomFichier.substring(0, strNomFichier.length() - 4);
12687 strNomFichierShp = strNomFichier + ".shp";
12688 String strNomFichierPng = strNomFichier + ".png";
12690 if (fichPng.exists()) {
12691 try {
12692 btnAjouteZone.setDisable(false);
12693 imgBarrePersonnalisee = new Image("file:" + fichPng);
12694 iNombreZones = getGestionnaireInterface().lisFichierShp(strNomFichierShp, zones);
12695 btnSauverBarre.setDisable(false);
12696 if (iNombreZones > 0) {
12697 cbMasqueZones.setDisable(false);
12698 }
12699 afficheBarrePersonnalisee(iLargeur, iHauteur, false);
12700
12701 } catch (IOException ex) {
12702 Logger.getLogger(EditeurPanovisu.class
12703 .getName()).log(Level.SEVERE, null, ex);
12704 }
12705
12706 }
12707 }
12708
12709 btnAnnulerBarre.setOnMouseClicked((t) -> {
12710 mbarPrincipal.setDisable(false);
12711 bbarPrincipal.setDisable(false);
12712 hbBarreBouton.setDisable(false);
12713 tpEnvironnement.setDisable(false);
12714 apCreationBarre.setVisible(false);
12715 });
12716
12717 btnAjouteZone.setOnMouseClicked((t) -> {
12718 btnAjouteZone.setDisable(true);
12719 ajouterZone(iLargeur, iHauteur, false);
12720 });
12721 btnChargeImage.setOnMouseClicked((t) -> {
12722 strRepertBarrePersonnalisee = getStrRepertAppli() + "/theme/telecommandes";
12724 fileRepert = new File(strRepertBarrePersonnalisee);
12726 FileChooser.ExtensionFilter efShpFilter = new FileChooser.ExtensionFilter("Fichiers barre personnalisée (SHP)", "*.shp", "*.png");
12727
12728 fileChooser.setInitialDirectory(fileRepert);
12729 fileChooser.getExtensionFilters().addAll(efShpFilter);
12730
12731 File fileFichierImage = fileChooser.showOpenDialog(null);
12732 if (fileFichierImage != null) {
12733 String strNomFichier = fileFichierImage.getAbsolutePath();
12734 strNomFichier = strNomFichier.substring(0, strNomFichier.length() - 4);
12735 strNomFichierShp = strNomFichier + ".shp";
12736 String strNomFichierPng = strNomFichier + ".png";
12738 if (fileFichierPng.exists()) {
12739 try {
12740 btnAjouteZone.setDisable(false);
12741 imgBarrePersonnalisee = new Image("file:" + fileFichierPng);
12742 iNombreZones = getGestionnaireInterface().lisFichierShp(strNomFichierShp, zones);
12743 btnSauverBarre.setDisable(false);
12744 if (iNombreZones > 0) {
12745 cbMasqueZones.setDisable(false);
12746 }
12747 afficheBarrePersonnalisee(iLargeur, iHauteur, false);
12748
12749 } catch (IOException ex) {
12750 Logger.getLogger(EditeurPanovisu.class
12751 .getName()).log(Level.SEVERE, null, ex);
12752 }
12753 }
12754 }
12755 });
12756
12757 btnSauverBarre.setOnMouseClicked((t) -> {
12758 try {
12759 sauverBarre(strNomFichierShp);
12760 getGestionnaireInterface().chargeBarrePersonnalisee(strNomFichierBarre);
12761
12762 } catch (IOException ex) {
12763 Logger.getLogger(EditeurPanovisu.class
12764 .getName()).log(Level.SEVERE, null, ex);
12765 }
12766 });
12767 cbMasqueZones.selectedProperty().addListener((ObservableValue<? extends Boolean> ov, Boolean old_val, Boolean new_val) -> {
12768 afficheBarrePersonnalisee(iLargeur, iHauteur, new_val);
12769 });
12770
12771 }
12772
12779 private void creeEnvironnement(Stage stPrimaryStage) throws Exception {
12780 creeEnvironnement(stPrimaryStage, 800, 600);
12781 }
12782
12788 private static void creeMenu(VBox vbRacine) throws Exception {
12789 vbMonPanneau = new VBox();
12790
12791 vbMonPanneau.setPrefHeight(80);
12792 vbMonPanneau.setPrefWidth(3000);
12793 mbarPrincipal.setMinHeight(29);
12794 mbarPrincipal.setPrefHeight(29);
12795 mbarPrincipal.setMaxHeight(29);
12796 mbarPrincipal.setPrefWidth(3000);
12797 if (isMac()) {
12798 mbarPrincipal.setUseSystemMenuBar(true);
12799 }
12800 /*
12801 Menu projets
12802 */
12803 Menu mnuProjet = new Menu(rbLocalisation.getString("projets"));
12804
12805 mbarPrincipal.getMenus().add(mnuProjet);
12806 mniNouveauProjet = new MenuItem(rbLocalisation.getString("nouveauProjet"));
12807 mniNouveauProjet.setAccelerator(new KeyCodeCombination(KeyCode.N, KeyCombination.SHORTCUT_DOWN));
12808 mnuProjet.getItems().add(mniNouveauProjet);
12809 mniChargeProjet = new MenuItem(rbLocalisation.getString("ouvrirProjet"));
12810 mniChargeProjet.setAccelerator(new KeyCodeCombination(KeyCode.O, KeyCombination.SHORTCUT_DOWN));
12811
12812 mnuProjet.getItems().add(mniChargeProjet);
12813 mniSauveProjet = new MenuItem(rbLocalisation.getString("sauverProjet"));
12814 mniSauveProjet.setDisable(true);
12815 mniSauveProjet.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.SHORTCUT_DOWN));
12816 mnuProjet.getItems().add(mniSauveProjet);
12817 mniSauveSousProjet = new MenuItem(rbLocalisation.getString("sauverProjetSous"));
12818 mniSauveSousProjet.setDisable(true);
12819 mniSauveSousProjet.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.SHORTCUT_DOWN, KeyCodeCombination.SHIFT_DOWN));
12820 mnuProjet.getItems().add(mniSauveSousProjet);
12821 mnuDerniersProjets = new Menu(rbLocalisation.getString("derniersProjets"));
12822 mnuProjet.getItems().add(mnuDerniersProjets);
12823 fileHistoFichiers = new File(fileRepertConfig.getAbsolutePath() + File.separator + "derniersprojets.cfg");
12824 nombreHistoFichiers = 0;
12825 if (fileHistoFichiers.exists()) {
12827 new FileInputStream(fileHistoFichiers), "UTF-8"))) {
12828 while ((strTexteHisto = brHistoFichiers.readLine()) != null) {
12829 MenuItem menuDerniersFichiers = new MenuItem(strTexteHisto);
12830 mnuDerniersProjets.getItems().add(menuDerniersFichiers);
12831 strHistoFichiers[nombreHistoFichiers] = strTexteHisto;
12832 nombreHistoFichiers++;
12833 menuDerniersFichiers.setOnAction((e) -> {
12834 MenuItem mniSousMenu = (MenuItem) e.getSource();
12835 try {
12836 try {
12837 projetChargeNom(mniSousMenu.getText());
12838
12839 } catch (InterruptedException ex) {
12840 Logger.getLogger(EditeurPanovisu.class
12841 .getName()).log(Level.SEVERE, null, ex);
12842 }
12843
12844 } catch (IOException ex) {
12845 Logger.getLogger(EditeurPanovisu.class
12846 .getName()).log(Level.SEVERE, null, ex);
12847 }
12848 });
12849
12850 }
12851 }
12852 }
12853
12855 mnuProjet.getItems().add(sepMenu1);
12856 mniFermerProjet = new MenuItem(rbLocalisation.getString("quitterApplication"));
12857 mniFermerProjet.setAccelerator(new KeyCodeCombination(KeyCode.A, KeyCombination.SHORTCUT_DOWN));
12858 mnuProjet.getItems().add(mniFermerProjet);
12859 /*
12860 Menu affichage
12861 */
12862 Menu mnuAffichage = new Menu(rbLocalisation.getString("affichage"));
12863 mbarPrincipal.getMenus().add(mnuAffichage);
12864 mniAffichageVisite = new MenuItem(rbLocalisation.getString("main.creationVisite"));
12865 mniAffichageVisite.setAccelerator(new KeyCodeCombination(KeyCode.DIGIT1, KeyCombination.SHORTCUT_DOWN));
12866 mnuAffichage.getItems().add(mniAffichageVisite);
12867 mniAffichageInterface = new MenuItem(rbLocalisation.getString("main.creationInterface"));
12868 mniAffichageInterface.setAccelerator(new KeyCodeCombination(KeyCode.DIGIT2, KeyCombination.SHORTCUT_DOWN));
12869 mnuAffichage.getItems().add(mniAffichageInterface);
12870 setMniAffichagePlan(new MenuItem(rbLocalisation.getString("main.tabPlan")));
12871 getMniAffichagePlan().setAccelerator(new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.SHORTCUT_DOWN));
12872 getMniAffichagePlan().setDisable(true);
12873 mnuAffichage.getItems().add(getMniAffichagePlan());
12874 mniOutilsLoupe = new MenuItem(
12875 rbLocalisation.getString("main.loupe")
12876 );
12877 mniOutilsLoupe.setAccelerator(new KeyCodeCombination(KeyCode.L, KeyCombination.SHORTCUT_DOWN));
12878 mnuAffichage.getItems().add(mniOutilsLoupe);
12879
12881 mnuAffichage.getItems().add(sep3);
12882 mniConfigTransformation = new MenuItem(rbLocalisation.getString("affichageConfiguration"));
12883 mnuAffichage.getItems().add(mniConfigTransformation);
12884
12885 // ✨ NOUVEAU : Menu pour changer de thème
12886 MenuItem mniChangerTheme = new MenuItem("Changer le thème...");
12887 mniChangerTheme.setAccelerator(new KeyCodeCombination(KeyCode.T, KeyCombination.SHORTCUT_DOWN));
12888 mniChangerTheme.setOnAction(e -> {
12889 try {
12890 afficherDialogueTheme();
12891 } catch (Exception ex) {
12892 ex.printStackTrace();
12893 }
12894 });
12895 mnuAffichage.getItems().add(mniChangerTheme);
12896
12897 /*
12898 Menu panoramiques
12899 */
12900 mnuPanoramique = new Menu(rbLocalisation.getString("panoramiques"));
12901 mnuPanoramique.setDisable(true);
12902 mbarPrincipal.getMenus().add(mnuPanoramique);
12903 mniAjouterPano = new MenuItem(rbLocalisation.getString("ajouterPanoramiques"));
12904 mniAjouterPano.setAccelerator(new KeyCodeCombination(KeyCode.A, KeyCombination.SHORTCUT_DOWN));
12905 mnuPanoramique.getItems().add(mniAjouterPano);
12906 setMniAjouterPlan(new MenuItem(rbLocalisation.getString("ajouterPlan")));
12907 getMniAjouterPlan().setAccelerator(new KeyCodeCombination(KeyCode.P, KeyCombination.SHORTCUT_DOWN));
12908 mnuPanoramique.getItems().add(getMniAjouterPlan());
12909 getMniAjouterPlan().setDisable(true);
12911 mnuPanoramique.getItems().add(sep2);
12912 mniVisiteGenere = new MenuItem(rbLocalisation.getString("genererVisite"));
12913 mniVisiteGenere.setDisable(true);
12914 mniVisiteGenere.setAccelerator(new KeyCodeCombination(KeyCode.V, KeyCombination.SHORTCUT_DOWN));
12915 mnuPanoramique.getItems().add(mniVisiteGenere);
12916
12917 mniCreerZipVisite = new MenuItem(rbLocalisation.getString("creerZipVisite"));
12918 mniCreerZipVisite.setDisable(true);
12919 mniCreerZipVisite.setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCombination.SHORTCUT_DOWN));
12920 mnuPanoramique.getItems().add(mniCreerZipVisite);
12921 /*
12922 Menu Modèles
12923 */
12924 mnuModeles = new Menu(rbLocalisation.getString("menuModele"));
12925 mbarPrincipal.getMenus().add(mnuModeles);
12926
12927 mniChargerModele = new MenuItem(rbLocalisation.getString("modeleCharger"));
12928 mnuModeles.getItems().add(mniChargerModele);
12929
12930 mniSauverModele = new MenuItem(rbLocalisation.getString("modeleSauver"));
12931 mnuModeles.getItems().add(mniSauverModele);
12932
12933 /*
12934 Menu transformations
12935 */
12936 mnuTransformation = new Menu(rbLocalisation.getString("outils"));
12937 mbarPrincipal.getMenus().add(mnuTransformation);
12938 mniEqui2CubeTransformation = new MenuItem(rbLocalisation.getString("outilsEqui2Cube"));
12939 mnuTransformation.getItems().add(mniEqui2CubeTransformation);
12940 mniCube2EquiTransformation = new MenuItem(rbLocalisation.getString("outilsCube2Equi"));
12941 mnuTransformation.getItems().add(mniCube2EquiTransformation);
12943 mnuTransformation.getItems().add(sep6);
12944 mniOutilsBarre = new MenuItem(rbLocalisation.getString("outilsBarre"));
12945 mniOutilsBarre.setAccelerator(new KeyCodeCombination(KeyCode.B, KeyCombination.SHORTCUT_DOWN));
12946 mnuTransformation.getItems().add(mniOutilsBarre);
12947 mniOutilsDiaporama = new MenuItem(rbLocalisation.getString("outilsDiaporama"));
12948 mniOutilsDiaporama.setAccelerator(new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN));
12949 mnuTransformation.getItems().add(mniOutilsDiaporama);
12950
12951 // Ajout d'un séparateur pour les outils d'images
12953 mnuTransformation.getItems().add(sep7);
12954
12955 // Nouveaux outils de traitement d'images
12956 mniRedimensionnerImages = new MenuItem(rbLocalisation.getString("outilsRedimensionnement"));
12957 mnuTransformation.getItems().add(mniRedimensionnerImages);
12958
12959 mniConvertirRatio2to1 = new MenuItem(rbLocalisation.getString("outilsRatio2to1"));
12960 mnuTransformation.getItems().add(mniConvertirRatio2to1);
12961
12962 /*
12963 Menu Aide
12964 */
12965 Menu mnuAide = new Menu(rbLocalisation.getString("aide"));
12966 mbarPrincipal.getMenus().add(mnuAide);
12967 mniDocumentation = new MenuItem(rbLocalisation.getString("aideDocumentation"));
12968 mniDocumentation.setAccelerator(new KeyCodeCombination(KeyCode.F1));
12969 mnuAide.getItems().add(mniDocumentation);
12970 // Supprimé : mniAide (option redondante, remplacée par Documentation)
12972 mnuAide.getItems().add(sep4);
12973 mniAPropos = new MenuItem(rbLocalisation.getString("aideAPropos"));
12974 mnuAide.getItems().add(mniAPropos);
12975//
12976// }
12977//
12978 /*
12979 barre de boutons
12980 */
12981 hbBarreBouton = new HBox();
12982 hbBarreBouton.getStyleClass().add("menuBarreOutils1");
12983
12984 hbBarreBouton.setPrefHeight(50);
12985 hbBarreBouton.setMinHeight(50);
12986 hbBarreBouton.setPrefWidth(3000);
12987 // Empêcher les icônes avec insets négatifs de déborder sur le menu
12988 javafx.scene.shape.Rectangle clip = new javafx.scene.shape.Rectangle();
12989 clip.widthProperty().bind(hbBarreBouton.widthProperty());
12990 clip.heightProperty().bind(hbBarreBouton.heightProperty());
12991 hbBarreBouton.setClip(clip);
12992 /*
12993 Bouton nouveau Projet
12994 */
12996 spBtnNouvprojet.getStyleClass().add("menuBarreOutils");
12997 spBtnNouvprojet.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
12998 spBtnNouvprojet.setPrefHeight(35);
12999 spBtnNouvprojet.setMaxHeight(35);
13000 spBtnNouvprojet.setPadding(new Insets(2));
13001 spBtnNouvprojet.setPrefWidth(35);
13002
13003 HBox.setMargin(spBtnNouvprojet, new Insets(5, 15, 0, 15));
13004 ivNouveauProjet = loadSvgIcon("nouveau-projet", 32);
13005 spBtnNouvprojet.setContent(ivNouveauProjet);
13006 Tooltip tltpNouveauProjet = new Tooltip(rbLocalisation.getString("nouveauProjet"));
13007 tltpNouveauProjet.setStyle(getStrTooltipStyle());
13009 hbBarreBouton.getChildren().add(spBtnNouvprojet);
13010 /*
13011 Bouton ouvrir Projet
13012 */
13014 spBtnOuvrirProjet.getStyleClass().add("menuBarreOutils");
13015 spBtnOuvrirProjet.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13016 spBtnOuvrirProjet.setPrefHeight(35);
13017 spBtnOuvrirProjet.setMaxHeight(35);
13018 spBtnOuvrirProjet.setPadding(new Insets(2));
13019 spBtnOuvrirProjet.setPrefWidth(35);
13020
13021 HBox.setMargin(spBtnOuvrirProjet, new Insets(5, 15, 0, 0));
13022 ivChargeProjet = loadSvgIcon("ouvrir-projet", 32);
13023 spBtnOuvrirProjet.setContent(ivChargeProjet);
13024 Tooltip tltpOuvrirProjet = new Tooltip(rbLocalisation.getString("ouvrirProjet"));
13025 tltpOuvrirProjet.setStyle(getStrTooltipStyle());
13027 hbBarreBouton.getChildren().add(spBtnOuvrirProjet);
13028
13029 /*
13030 Bouton sauve Projet
13031 */
13033 spBtnSauveProjet.getStyleClass().add("menuBarreOutils");
13034 spBtnSauveProjet.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13035 spBtnSauveProjet.setPrefHeight(35);
13036 spBtnSauveProjet.setMaxHeight(35);
13037 spBtnSauveProjet.setPadding(new Insets(2));
13038 spBtnSauveProjet.setPrefWidth(35);
13039
13040 HBox.setMargin(spBtnSauveProjet, new Insets(5, 15, 0, 0));
13041 ivSauveProjet = loadSvgIcon("sauve-projet", 32);
13042 spBtnSauveProjet.setContent(ivSauveProjet);
13043 Tooltip tltpSauverProjet = new Tooltip(rbLocalisation.getString("sauverProjet"));
13044 tltpSauverProjet.setStyle(getStrTooltipStyle());
13046 hbBarreBouton.getChildren().add(spBtnSauveProjet);
13047 Separator sepImages = new Separator(Orientation.VERTICAL);
13048 sepImages.prefHeight(200);
13049 hbBarreBouton.getChildren().add(sepImages);
13050 ivSauveProjet.setDisable(true);
13051 ivSauveProjet.setOpacity(0.3);
13052 /*
13053 Bouton Ajoute Panoramique
13054 */
13056 spBtnAjoutePano.getStyleClass().add("menuBarreOutils");
13057 spBtnAjoutePano.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13058 spBtnAjoutePano.setPrefHeight(35);
13059 spBtnAjoutePano.setMaxHeight(35);
13060 spBtnAjoutePano.setPadding(new Insets(2));
13061 spBtnAjoutePano.setPrefWidth(35);
13062
13063 HBox.setMargin(spBtnAjoutePano, new Insets(5, 15, 0, 15));
13064 ivAjouterPano = loadSvgIcon("ajoute-panoramique", 32);
13065 spBtnAjoutePano.setContent(ivAjouterPano);
13066 Tooltip tltpAjouterPano = new Tooltip(rbLocalisation.getString("ajouterPanoramiques"));
13067 tltpAjouterPano.setStyle(getStrTooltipStyle());
13068 spBtnAjoutePano.setTooltip(tltpAjouterPano);
13069 hbBarreBouton.getChildren().add(spBtnAjoutePano);
13070 ivAjouterPano.setDisable(true);
13071 ivAjouterPano.setOpacity(0.3);
13072
13073 /*
13074 Bouton Ajoute Panoramique
13075 */
13077 spBtnAjoutePlan.getStyleClass().add("menuBarreOutils");
13078 spBtnAjoutePlan.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13079 spBtnAjoutePlan.setPrefHeight(35);
13080 spBtnAjoutePlan.setMaxHeight(35);
13081 spBtnAjoutePlan.setPadding(new Insets(2));
13082 spBtnAjoutePlan.setPrefWidth(35);
13083
13084 HBox.setMargin(spBtnAjoutePlan, new Insets(5, 15, 0, 15));
13085 setIvAjouterPlan(loadSvgIcon("ajoute-plan", 32));
13086 spBtnAjoutePlan.setContent(getIvAjouterPlan());
13087 Tooltip tltpAjouterPlan = new Tooltip(rbLocalisation.getString("ajouterPlan"));
13088 tltpAjouterPlan.setStyle(getStrTooltipStyle());
13089 spBtnAjoutePlan.setTooltip(tltpAjouterPlan);
13090 hbBarreBouton.getChildren().add(spBtnAjoutePlan);
13091 getIvAjouterPlan().setDisable(true);
13092 getIvAjouterPlan().setOpacity(0.3);
13093
13094 /*
13095 Bouton Génère
13096 */
13098 spBtnGenereVisite.getStyleClass().add("menuBarreOutils");
13099 spBtnGenereVisite.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13100 spBtnGenereVisite.setPrefHeight(35);
13101 spBtnGenereVisite.setMaxHeight(35);
13102 spBtnGenereVisite.setPadding(new Insets(2));
13103 spBtnGenereVisite.setPrefWidth(70);
13104
13105 HBox.setMargin(spBtnGenereVisite, new Insets(5, 3, 0, 0));
13106 ivVisiteGenere = loadSvgIcon("genere-visite", 32);
13107 spBtnGenereVisite.setContent(ivVisiteGenere);
13108 Tooltip tltpGenererVisite = new Tooltip(rbLocalisation.getString("genererVisite"));
13109 tltpGenererVisite.setStyle(getStrTooltipStyle());
13111 hbBarreBouton.getChildren().add(spBtnGenereVisite);
13112 ivVisiteGenere.setDisable(true);
13113 ivVisiteGenere.setOpacity(0.3);
13114
13115 /*
13116 Bouton Génère ZIP
13117 */
13119 spBtnGenereZip.getStyleClass().add("menuBarreOutils");
13120 spBtnGenereZip.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13121 spBtnGenereZip.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13122 spBtnGenereZip.setPrefHeight(30);
13123 spBtnGenereZip.setMaxHeight(30);
13124 spBtnGenereZip.setPadding(new Insets(0));
13125 spBtnGenereZip.setPrefWidth(35);
13126
13127 HBox.setMargin(spBtnGenereZip, new Insets(5, 3, 0, -5));
13128 ivGenereZip = loadSvgIcon("genere-zip", 35);
13129 spBtnGenereZip.setContent(ivGenereZip);
13130 Tooltip tltpGenererZip = new Tooltip(rbLocalisation.getString("creerZipVisite"));
13131 tltpGenererZip.setStyle(getStrTooltipStyle());
13132 spBtnGenereZip.setTooltip(tltpGenererZip);
13133 hbBarreBouton.getChildren().add(spBtnGenereZip);
13134 ivGenereZip.setDisable(true);
13135 ivGenereZip.setOpacity(0.3);
13136
13137 Separator sepImages1 = new Separator(Orientation.VERTICAL);
13138 sepImages1.prefHeight(200);
13139 hbBarreBouton.getChildren().add(sepImages1);
13140
13141 /*
13142 Bouton Redimensionner/Compresser les images
13143 */
13145 spBtnRedimensionner.getStyleClass().add("menuBarreOutils");
13146 spBtnRedimensionner.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13147 spBtnRedimensionner.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13148 spBtnRedimensionner.setPrefHeight(72);
13149 spBtnRedimensionner.setMaxHeight(72);
13150 spBtnRedimensionner.setPadding(new Insets(0));
13151 spBtnRedimensionner.setPrefWidth(90);
13152 spBtnRedimensionner.setMaxWidth(145);
13153 spBtnRedimensionner.setFitToHeight(true);
13154 spBtnRedimensionner.setFitToWidth(true);
13155
13156 HBox.setMargin(spBtnRedimensionner, new Insets(-3, -3, 0, 3));
13157 ivRedimensionnerImages = loadSvgIcon("redimensionner-images", 95, 48, null);
13158 spBtnRedimensionner.setContent(ivRedimensionnerImages);
13159 Tooltip tltpRedimensionner = new Tooltip(rbLocalisation.getString("outilsRedimensionnement"));
13160 tltpRedimensionner.setStyle(getStrTooltipStyle());
13162 hbBarreBouton.getChildren().add(spBtnRedimensionner);
13163
13164 /*
13165 Bouton Convertir au ratio 2:1
13166 */
13168 spBtnRatio2to1.getStyleClass().add("menuBarreOutils");
13169 spBtnRatio2to1.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13170 spBtnRatio2to1.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13171 spBtnRatio2to1.setPrefHeight(72);
13172 spBtnRatio2to1.setMaxHeight(72);
13173 spBtnRatio2to1.setPadding(new Insets(0));
13174 spBtnRatio2to1.setPrefWidth(100);
13175 spBtnRatio2to1.setMaxWidth(145);
13176 spBtnRatio2to1.setFitToHeight(true);
13177 spBtnRatio2to1.setFitToWidth(true);
13178
13179 HBox.setMargin(spBtnRatio2to1, new Insets(-10, 3, 0, -5));
13180 ivConvertirRatio2to1 = loadSvgIcon("ratio-2to1", 128, 72, null);
13181 spBtnRatio2to1.setContent(ivConvertirRatio2to1);
13182 Tooltip tltpRatio2to1 = new Tooltip(rbLocalisation.getString("outilsRatio2to1"));
13183 tltpRatio2to1.setStyle(getStrTooltipStyle());
13184 spBtnRatio2to1.setTooltip(tltpRatio2to1);
13185 hbBarreBouton.getChildren().add(spBtnRatio2to1);
13186
13187 /*
13188 Bouton equi -> faces de Cube
13189 */
13191 spBtnEqui2Cube.getStyleClass().add("menuBarreOutils");
13192 spBtnEqui2Cube.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13193 spBtnEqui2Cube.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13194 spBtnEqui2Cube.setPrefHeight(72);
13195 spBtnEqui2Cube.setMaxHeight(72);
13196 spBtnEqui2Cube.setPadding(new Insets(0));
13197 spBtnEqui2Cube.setPrefWidth(145);
13198 spBtnEqui2Cube.setMaxWidth(145);
13199 spBtnEqui2Cube.setFitToHeight(true);
13200 spBtnEqui2Cube.setFitToWidth(true);
13201
13202 HBox.setMargin(spBtnEqui2Cube, new Insets(-4, 15, 0, 20));
13203 ivEqui2Cube = loadSvgIcon("vue-sphere", 128, 64, null);
13204 spBtnEqui2Cube.setContent(ivEqui2Cube);
13205 Tooltip tltpEqui2Cube = new Tooltip(rbLocalisation.getString("outilsEqui2Cube"));
13206 tltpEqui2Cube.setStyle(getStrTooltipStyle());
13207 spBtnEqui2Cube.setTooltip(tltpEqui2Cube);
13208 hbBarreBouton.getChildren().add(spBtnEqui2Cube);
13209
13210 /*
13211 Bouton faces de cube -> equi
13212 */
13214 spBtnCube2Equi.getStyleClass().add("menuBarreOutils");
13215 spBtnCube2Equi.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13216 spBtnCube2Equi.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
13217 spBtnCube2Equi.setPrefHeight(72);
13218 spBtnCube2Equi.setMaxHeight(72);
13219 spBtnCube2Equi.setPadding(new Insets(0));
13220 spBtnCube2Equi.setPrefWidth(145);
13221 spBtnCube2Equi.setMaxWidth(145);
13222 spBtnCube2Equi.setFitToHeight(true);
13223 spBtnCube2Equi.setFitToWidth(true);
13224
13225 HBox.setMargin(spBtnCube2Equi, new Insets(-4, 25, 0, 5));
13226 ivCube2Equi = loadSvgIcon("vue-cube", 128, 64, null);
13227 spBtnCube2Equi.setContent(ivCube2Equi);
13228 Tooltip tltpCube2Equi = new Tooltip(rbLocalisation.getString("outilsCube2Equi"));
13229 tltpCube2Equi.setStyle(getStrTooltipStyle());
13230 spBtnCube2Equi.setTooltip(tltpCube2Equi);
13231 hbBarreBouton.getChildren().add(spBtnCube2Equi);
13232 if (isMac()) {
13233 mbarPrincipal.setMaxHeight(0);
13234 hbBarreBouton.setTranslateY(-30);
13235 }
13236 vbMonPanneau.getChildren().addAll(mbarPrincipal, hbBarreBouton);
13237 vbRacine.getChildren().add(vbMonPanneau);
13238 mniNouveauProjet.setOnAction((e) -> {
13239 projetsNouveau();
13240 });
13241 mniChargeProjet.setOnAction((e) -> {
13242 try {
13243 try {
13244 projetCharge();
13245
13246 } catch (InterruptedException ex) {
13247 Logger.getLogger(EditeurPanovisu.class
13248 .getName()).log(Level.SEVERE, null, ex);
13249 }
13250
13251 } catch (IOException ex) {
13252 Logger.getLogger(EditeurPanovisu.class
13253 .getName()).log(Level.SEVERE, null, ex);
13254 }
13255 });
13256 mniSauveProjet.setOnAction((e) -> {
13257 try {
13258 projetSauve();
13259
13260 } catch (IOException ex) {
13261 Logger.getLogger(EditeurPanovisu.class
13262 .getName()).log(Level.SEVERE, null, ex);
13263 }
13264 });
13265 mniSauveSousProjet.setOnAction((e) -> {
13266 try {
13267 projetSauveSous();
13268
13269 } catch (IOException ex) {
13270 Logger.getLogger(EditeurPanovisu.class
13271 .getName()).log(Level.SEVERE, null, ex);
13272 }
13273 });
13274 mniVisiteGenere.setOnAction((e) -> {
13275 try {
13276 genereVisite();
13277
13278 } catch (IOException ex) {
13279 Logger.getLogger(EditeurPanovisu.class
13280 .getName()).log(Level.SEVERE, null, ex);
13281 }
13282 });
13283
13284 mniCreerZipVisite.setOnAction((e) -> {
13285 try {
13286 creerZipVisite();
13287
13288 } catch (IOException ex) {
13289 Logger.getLogger(EditeurPanovisu.class
13290 .getName()).log(Level.SEVERE, null, ex);
13291 }
13292 });
13293
13294 mniFermerProjet.setOnAction((e) -> {
13295 try {
13296 projetsFermer();
13297
13298 } catch (IOException ex) {
13299 Logger.getLogger(EditeurPanovisu.class
13300 .getName()).log(Level.SEVERE, null, ex);
13301 }
13302 });
13303 mniAjouterPano.setOnAction((e) -> {
13304 try {
13305 panoramiquesAjouter();
13306
13307 } catch (InterruptedException ex) {
13308 Logger.getLogger(EditeurPanovisu.class
13309 .getName()).log(Level.SEVERE, null, ex);
13310 }
13311 });
13312 getMniAjouterPlan().setOnAction((e) -> {
13313 planAjouter();
13314 });
13315 mniAPropos.setOnAction((e) -> {
13316 aideapropos();
13317 });
13318 // Supprimé : gestionnaire pour mniAide (option redondante avec Documentation)
13319 mniDocumentation.setOnAction((e) -> {
13321 });
13322
13323 mniChargerModele.setOnAction((e) -> {
13324 try {
13325 modeleCharger();
13326
13327 } catch (IOException ex) {
13328 Logger.getLogger(EditeurPanovisu.class
13329 .getName()).log(Level.SEVERE, null, ex);
13330 }
13331 });
13332
13333 mniSauverModele.setOnAction((e) -> {
13334 try {
13335 modeleSauver();
13336
13337 } catch (IOException ex) {
13338 Logger.getLogger(EditeurPanovisu.class
13339 .getName()).log(Level.SEVERE, null, ex);
13340 }
13341 });
13342
13343 mniCube2EquiTransformation.setOnAction((e) -> {
13344 transformationCube2Equi();
13345 });
13346
13347 mniEqui2CubeTransformation.setOnAction((e) -> {
13348 transformationEqui2Cube();
13349 });
13350
13351 mniOutilsBarre.setOnAction((e) -> {
13352 creerEditerBarre("");
13353 });
13354 mniOutilsDiaporama.setOnAction((e) -> {
13355 creerEditerDiaporama("");
13356 });
13357
13358 // Gestionnaires d'événements pour les nouveaux outils d'images
13359 mniRedimensionnerImages.setOnAction((e) -> {
13360 ouvrirOutilRedimensionnementImages();
13361 });
13362
13363 mniConvertirRatio2to1.setOnAction((e) -> {
13364 ouvrirOutilConversionRatio2to1();
13365 });
13366 mniOutilsLoupe.setOnAction((e) -> {
13367 e.consume();
13368 setAfficheLoupe(!isAfficheLoupe());
13369 apLoupe.setVisible(isAfficheLoupe());
13370 Point p = MouseInfo.getPointerInfo().getLocation();
13371 if (p.x < getiTailleLoupe() + 80 && p.y < getiTailleLoupe() + 160) {
13372 apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
13373 apLoupe.setLayoutY(35);
13374 strPositLoupe = "droite";
13375 } else {
13376 apLoupe.setLayoutX(35);
13377 apLoupe.setLayoutY(35);
13378 strPositLoupe = "gauche";
13379 }
13380 });
13381
13382 mniAffichageVisite.setOnAction((e) -> {
13383 tpEnvironnement.getSelectionModel().select(0);
13384 });
13385 mniAffichageInterface.setOnAction((e) -> {
13386 tpEnvironnement.getSelectionModel().select(1);
13387 });
13388 getMniAffichagePlan().setOnAction((e) -> {
13389 if (!tabPlan.isDisabled()) {
13390 tpEnvironnement.getSelectionModel().select(2);
13391 }
13392 });
13393
13394 mniConfigTransformation.setOnAction((e) -> {
13395 try {
13397 cfg.afficheFenetre();
13398
13399 } catch (IOException ex) {
13400 Logger.getLogger(EditeurPanovisu.class
13401 .getName()).log(Level.SEVERE, null, ex);
13402 }
13403 });
13404
13405 spBtnNouvprojet.setOnMouseClicked((t) -> {
13406 projetsNouveau();
13407 });
13408 spBtnOuvrirProjet.setOnMouseClicked((t) -> {
13409 try {
13410 try {
13411 projetCharge();
13412
13413 } catch (InterruptedException ex) {
13414 Logger.getLogger(EditeurPanovisu.class
13415 .getName()).log(Level.SEVERE, null, ex);
13416 }
13417
13418 } catch (IOException ex) {
13419 Logger.getLogger(EditeurPanovisu.class
13420 .getName()).log(Level.SEVERE, null, ex);
13421 }
13422 });
13423 spBtnSauveProjet.setOnMouseClicked((t) -> {
13424 try {
13425 projetSauve();
13426
13427 } catch (IOException ex) {
13428 Logger.getLogger(EditeurPanovisu.class
13429 .getName()).log(Level.SEVERE, null, ex);
13430 }
13431 });
13432 spBtnAjoutePano.setOnMouseClicked((t) -> {
13433 try {
13434 panoramiquesAjouter();
13435
13436 } catch (InterruptedException ex) {
13437 Logger.getLogger(EditeurPanovisu.class
13438 .getName()).log(Level.SEVERE, null, ex);
13439 }
13440 });
13441 spBtnAjoutePlan.setOnMouseClicked((t) -> {
13442 planAjouter();
13443 });
13444 spBtnGenereVisite.setOnMouseClicked((t) -> {
13445 try {
13446 genereVisite();
13447
13448 } catch (IOException ex) {
13449 Logger.getLogger(EditeurPanovisu.class
13450 .getName()).log(Level.SEVERE, null, ex);
13451 }
13452 });
13453 spBtnGenereZip.setOnMouseClicked((t) -> {
13454 try {
13455 creerZipVisite();
13456
13457 } catch (IOException ex) {
13458 Logger.getLogger(EditeurPanovisu.class
13459 .getName()).log(Level.SEVERE, null, ex);
13460 }
13461 });
13462
13463 spBtnRedimensionner.setOnMouseClicked((t) -> {
13464 ouvrirOutilRedimensionnementImages();
13465 });
13466
13467 spBtnRatio2to1.setOnMouseClicked((t) -> {
13468 ouvrirOutilConversionRatio2to1();
13469 });
13470
13471 spBtnEqui2Cube.setOnMouseClicked((t) -> {
13472 transformationEqui2Cube();
13473 });
13474 spBtnCube2Equi.setOnMouseClicked((t) -> {
13475 transformationCube2Equi();
13476 });
13477
13478 }
13479
13483 private static void retirePanoCourant() {
13484 ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
13485 ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
13486 Alert alert = new Alert(AlertType.WARNING);
13487 alert.setTitle(rbLocalisation.getString("main.supprimerPano"));
13488 alert.setHeaderText(null);
13489 alert.setContentText(rbLocalisation.getString("main.etesVousSur"));
13490 alert.getButtonTypes().clear();
13491 alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon);
13492 Optional<ButtonType> actReponse = alert.showAndWait();
13493
13494 if (actReponse.get() == buttonTypeOui) {
13495 File fImage;
13496 for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreNiveaux(); i++) {
13497 if (getPanoramiquesProjet()[getiPanoActuel()].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
13498 fImage = new File(
13499 getStrRepertTemp()
13500 + File.separator
13501 + "panos"
13502 + File.separator
13503 + "niveau" + i
13504 + File.separator
13505 + "panovisu" + getiPanoActuel() + ".jpg"
13506 );
13507 fImage.delete();
13508 } else {
13509 String strNom = getStrRepertTemp()
13511 + "panos"
13513 + "niveau" + i
13515 + "panovisu" + getiPanoActuel();
13516 fImage = new File(strNom + "_u.jpg");
13517 fImage.delete();
13518 fImage = new File(strNom + "_d.jpg");
13519 fImage.delete();
13520 fImage = new File(strNom + "_l.jpg");
13521 fImage.delete();
13522 fImage = new File(strNom + "_r.jpg");
13523 fImage.delete();
13524 fImage = new File(strNom + "_f.jpg");
13525 fImage.delete();
13526 fImage = new File(strNom + "_b.jpg");
13527 fImage.delete();
13528 }
13529 }
13530 if (getPanoramiquesProjet()[getiPanoActuel()].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
13531 fImage = new File(
13532 getStrRepertTemp()
13533 + File.separator
13534 + "panos"
13535 + File.separator
13536 + "panovisu" + getiPanoActuel() + ".jpg"
13537 );
13538 fImage.delete();
13539 } else {
13540 String strNom = getStrRepertTemp()
13542 + "panos"
13544 + "panovisu" + getiPanoActuel();
13545 fImage = new File(strNom + "_u.jpg");
13546 fImage.delete();
13547 fImage = new File(strNom + "_d.jpg");
13548 fImage.delete();
13549 fImage = new File(strNom + "_l.jpg");
13550 fImage.delete();
13551 fImage = new File(strNom + "_r.jpg");
13552 fImage.delete();
13553 fImage = new File(strNom + "_f.jpg");
13554 fImage.delete();
13555 fImage = new File(strNom + "_b.jpg");
13556 fImage.delete();
13557 }
13558
13559 int iPanCourant = cbListeChoixPanoramique.getSelectionModel().getSelectedIndex();
13561 for (int i = iPanCourant; i < getiNombrePanoramiques() - 1; i++) {
13562 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreNiveaux(); j++) {
13563 if (getPanoramiquesProjet()[getiPanoActuel()].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
13564 fImage = new File(
13565 getStrRepertTemp()
13566 + File.separator
13567 + "panos"
13568 + File.separator
13569 + "niveau" + j
13570 + File.separator
13571 + "panovisu" + (i + 1) + ".jpg"
13572 );
13573 fileRemplace = new File(
13574 getStrRepertTemp()
13575 + File.separator
13576 + "panos"
13577 + File.separator
13578 + "niveau" + j
13579 + File.separator
13580 + "panovisu" + i + ".jpg"
13581 );
13582 fImage.renameTo(fileRemplace);
13583 } else {
13584 String strNom = getStrRepertTemp()
13586 + "panos"
13588 + "niveau" + j
13590 + "panovisu" + (i + 1);
13591 String strNom1 = getStrRepertTemp()
13593 + "panos"
13595 + "niveau" + j
13597 + "panovisu" + i;
13598 fImage = new File(strNom + "_u.jpg");
13599 fileRemplace = new File(strNom1 + "_u.jpg");
13600 fImage.renameTo(fileRemplace);
13601 fImage = new File(strNom + "_d.jpg");
13602 fileRemplace = new File(strNom1 + "_d.jpg");
13603 fImage.renameTo(fileRemplace);
13604 fImage = new File(strNom + "_l.jpg");
13605 fileRemplace = new File(strNom1 + "_l.jpg");
13606 fImage.renameTo(fileRemplace);
13607 fImage = new File(strNom + "_r.jpg");
13608 fileRemplace = new File(strNom1 + "_r.jpg");
13609 fImage.renameTo(fileRemplace);
13610 fImage = new File(strNom + "_f.jpg");
13611 fileRemplace = new File(strNom1 + "_f.jpg");
13612 fImage.renameTo(fileRemplace);
13613 fImage = new File(strNom + "_b.jpg");
13614 fileRemplace = new File(strNom1 + "_b.jpg");
13615 fImage.renameTo(fileRemplace);
13616 }
13617
13618 }
13619 if (getPanoramiquesProjet()[getiPanoActuel()].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
13620 fImage = new File(
13621 getStrRepertTemp()
13622 + File.separator
13623 + "panos"
13624 + File.separator
13625 + "panovisu" + (i + 1) + ".jpg"
13626 );
13627 fileRemplace = new File(
13628 getStrRepertTemp()
13629 + File.separator
13630 + "panos"
13631 + File.separator
13632 + "panovisu" + i + ".jpg"
13633 );
13634 fImage.renameTo(fileRemplace);
13635 } else {
13636 String strNom = getStrRepertTemp()
13638 + "panos"
13640 + "panovisu" + (i + 1);
13641 String strNom1 = getStrRepertTemp()
13643 + "panos"
13645 + "panovisu" + i;
13646 fImage = new File(strNom + "_u.jpg");
13647 fileRemplace = new File(strNom1 + "_u.jpg");
13648 fImage.renameTo(fileRemplace);
13649 fImage = new File(strNom + "_d.jpg");
13650 fileRemplace = new File(strNom1 + "_d.jpg");
13651 fImage.renameTo(fileRemplace);
13652 fImage = new File(strNom + "_l.jpg");
13653 fileRemplace = new File(strNom1 + "_l.jpg");
13654 fImage.renameTo(fileRemplace);
13655 fImage = new File(strNom + "_r.jpg");
13656 fileRemplace = new File(strNom1 + "_r.jpg");
13657 fImage.renameTo(fileRemplace);
13658 fImage = new File(strNom + "_f.jpg");
13659 fileRemplace = new File(strNom1 + "_f.jpg");
13660 fImage.renameTo(fileRemplace);
13661 fImage = new File(strNom + "_b.jpg");
13662 fileRemplace = new File(strNom1 + "_b.jpg");
13663 fImage.renameTo(fileRemplace);
13664 }
13665 getPanoramiquesProjet()[i] = getPanoramiquesProjet()[i + 1];
13666 }
13667 for (int i = 0; i < getiNombrePanoramiques() - 1; i++) {
13668 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspots(); j++) {
13669 if (getPanoramiquesProjet()[i].getHotspot(j).getNumeroPano() == iPanCourant) {
13670 getPanoramiquesProjet()[i].removeHotspot(j);
13671 }
13672 }
13673 }
13674
13675 for (int i = 0; i < getiNombrePanoramiques() - 1; i++) {
13676 for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspots(); j++) {
13677 if (getPanoramiquesProjet()[i].getHotspot(j).getNumeroPano() > iPanCourant) {
13678 getPanoramiquesProjet()[i].getHotspot(j).setNumeroPano(getPanoramiquesProjet()[i].getHotspot(j).getNumeroPano() - 1);
13679 }
13680 }
13681 }
13682 for (int i = 0; i < getiNombrePlans(); i++) {
13683 for (int j = 0; j < getPlans()[i].getNombreHotspots(); j++) {
13684 if (getPlans()[i].getHotspot(j).getNumeroPano() == iPanCourant) {
13685 getPlans()[i].removeHotspot(j);
13686 }
13687 }
13688 }
13689
13690 for (int i = 0; i < getiNombrePlans(); i++) {
13691 for (int j = 0; j < getPlans()[i].getNombreHotspots(); j++) {
13692 if (getPlans()[i].getHotspot(j).getNumeroPano() > iPanCourant) {
13693 getPlans()[i].getHotspot(j).setNumeroPano(getPlans()[i].getHotspot(j).getNumeroPano() - 1);
13694 }
13695 }
13696 }
13697
13698 cbListeChoixPanoramique.setValue(cbListeChoixPanoramique.getItems().get(0));
13699 affichePanoChoisit(0);
13700 ordPano.supprimerElement(iPanCourant);
13701 apListePanoTriable = ordPano.getApListePanoramiques();
13702 apListePanoTriable.setMaxHeight(apListePanoTriable.getPrefHeight());
13703 apListePanoTriable.setMinHeight(apListePanoTriable.getPrefHeight());
13704 apParametresVisite.setPrefHeight(120 + apListePanoTriable.getPrefHeight() + 20);
13705 if (apParametresVisite.isVisible()) {
13706 apParametresVisite.setMinHeight(120 + apListePanoTriable.getPrefHeight() + 20);
13707 apParametresVisite.setMaxHeight(120 + apListePanoTriable.getPrefHeight() + 20);
13708 }
13709 rafraichitListePano();
13710 setiNombrePanoramiques(getiNombrePanoramiques() - 1);
13711 }
13712 }
13713
13721 private static void creeEnvironnement(Stage stPrimaryStage, int iLargeur, int iHauteur) throws Exception {
13722 popUp = new PopUpDialogController();
13723 stPrimaryStage.setMaximized(true);
13724 stPrimaryStage.setMinWidth(1280);
13725 stPrimaryStage.setMinHeight(720);
13726
13727 iHauteurInterface = iHauteur;
13728 iLargeurInterface = iLargeur;
13732 vbRacine = new VBox();
13733 AnchorPane panePrincipale = new AnchorPane(vbRacine);
13734 setScnPrincipale(new Scene(panePrincipale, iLargeur, iHauteur, Color.rgb(221, 221, 221)));
13735
13736 // ✨ NOUVEAU : Appliquer le thème moderne AtlantaFX
13737 if (!fileRepertConfig.exists()) {
13738 fileRepertConfig.mkdirs();
13739 setLocale(new Locale("fr", "FR"));
13740 // Appliquer le thème par défaut (Primer Light)
13742 setStrRepertoireProjet(getStrRepertAppli());
13743 } else {
13744 lisFichierConfig();
13745 // Charger et appliquer le thème sauvegardé
13746 ThemeManager.applySavedTheme(getScnPrincipale());
13747 }
13748
13749 creeMenu(vbRacine);
13750
13751 tpEnvironnement = new TabPane();
13752 tpEnvironnement.setMinHeight(iHauteur - 60);
13753 tpEnvironnement.setMaxHeight(iHauteur - 60);
13754 tpEnvironnement.setMinWidth(iLargeur);
13755 tpEnvironnement.setMaxWidth(iLargeur);
13756 Pane paneBarreStatus = new Pane();
13757 paneBarreStatus.setPrefSize(iLargeur + 20, 30);
13758 paneBarreStatus.setTranslateY(25);
13759 paneBarreStatus.setStyle("-fx-background-color:#c00;-fx-border-color:#aaa");
13760 tabVisite = new Tab();
13762 Pane panePlan;
13763 setTabInterface(new Tab());
13764 setTabPlan(new Tab());
13765 getGestionnaireInterface().creeInterface(iLargeur, iHauteur - 78);
13766 paneVisualiseur = getGestionnaireInterface().paneTabInterface;
13767 getGestionnairePlan().creeInterface(iLargeur, iHauteur - 78);
13768 panePlan = getGestionnairePlan().getPaneInterface();
13769 getTabInterface().setContent(paneVisualiseur);
13770 getTabPlan().setContent(panePlan);
13771
13772 HBox hbEnvironnement = new HBox();
13773 TextField tfTitrePano;
13774 TextField tfTitreVisite;
13775
13776 tpEnvironnement.getTabs().addAll(tabVisite, getTabInterface(), getTabPlan());
13777 tpEnvironnement.setSide(Side.TOP);
13778 tpEnvironnement.getSelectionModel().selectedItemProperty().addListener((ObservableValue<? extends Tab> ov, Tab t, Tab t1) -> {
13779 if (getGestionnaireInterface().navigateurCarteOL == null && isbInternet()) {
13780 getGestionnaireInterface().navigateurCarteOL = new NavigateurCarte();
13781 // NavigateurCarte se charge automatiquement
13782 }
13783 getGestionnaireInterface().rafraichit();
13784 });
13785 tabInterface.disableProperty().addListener((ov, av, nv) -> {
13786 if (!nv && getGestionnaireInterface().navigateurCarteOL == null && isbInternet()) {
13787 getGestionnaireInterface().navigateurCarteOL = new NavigateurCarte();
13788 // NavigateurCarte se charge automatiquement
13789 }
13790 });
13791
13792 tabVisite.setText(rbLocalisation.getString("main.creationVisite"));
13793 tabVisite.setClosable(false);
13794 tabVisite.setStyle("-fx-font-size: 16px; -fx-font-weight: bold;");
13795 getTabInterface().setText(rbLocalisation.getString("main.creationInterface"));
13796 getTabInterface().setClosable(false);
13797 getTabInterface().setStyle("-fx-font-size: 16px; -fx-font-weight: bold;");
13798 getTabPlan().setText(rbLocalisation.getString("main.tabPlan"));
13799 getTabPlan().setClosable(false);
13800 getTabPlan().setStyle("-fx-font-size: 16px; -fx-font-weight: bold;");
13801 getTabPlan().setDisable(true);
13802 // L'onglet "Modèle d'interface" permet de créer des modèles indépendamment d'un projet
13803 // Il est toujours actif, même sans Internet (carte remplacée par image fallback)
13804 // Le bouton de géolocalisation est désactivé si pas d'Internet
13805 tabVisite.setContent(hbEnvironnement);
13806 double largeur;
13807 String strLabelStyle = "-fx-color : white;-fx-background-color : #fff;-fx-padding : 5px; -fx-border : 1px solid #777;-fx-width : 100px;-fx-margin : 5px; ";
13808 vbRacine.setStyle("-fx-font-size : 9pt;-fx-font-family: Arial;");
13809 vbRacine.setTranslateY(15);
13810 spPanneauOutils = new ScrollPane();
13811 spPanneauOutils.setId("panOutils");
13812 vbOutils = new VBox(-5);
13813 vbOutils.setPrefWidth(largeurOutils - 20);
13814 setVbChoixPanoramique(new VBox());
13815 getVbChoixPanoramique().setId("choixPanoramique");
13816 double largeurOutil = vbOutils.getPrefWidth();
13817
13818 apPanovisu = new AnchorPane();
13819 apPanovisu.setPrefHeight(50);
13820 apPanovisu.setMinHeight(50);
13821 apPanovisu.setMaxHeight(50);
13822
13823 apPanovisu.setMaxWidth(380);
13824 apPanovisu.setPrefWidth(380);
13825 apPanovisu.setMinWidth(380);
13826 apPanovisu.setLayoutX(iLargeur - 380);
13827 if (isMac()) {
13828 apPanovisu.setLayoutY(0);
13829
13830 } else {
13831 apPanovisu.setLayoutY(45);
13832 }
13833 apPanovisu.setStyle("-fx-background-color : derive(-fx-base,20%);");
13834
13835 ImageView ivPanoVisu = new ImageView(new Image("file:" + getStrRepertAppli() + File.separator + "images/panovisu.png", 48, 48, true, true));
13836 ivPanoVisu.setLayoutX(40);
13837 ivPanoVisu.setLayoutY(1);
13838 Label lblPanoVisu = new Label("panoVisu Vers. : " + strNumVersion);
13839 lblPanoVisu.setStyle("-fx-font-weight : bold;-fx-font-family : Verdana,Arial,sans-serif;-fx-font-size : 1.2em;");
13840 lblPanoVisu.setLayoutX(108);
13841 lblPanoVisu.setLayoutY(5);
13842 Label lblPanoVisu2 = new Label("Laurent LANG (2014-2025)");
13843 lblPanoVisu2.setLayoutX(108);
13844 lblPanoVisu2.setLayoutY(35);
13845 lblPanoVisu2.setStyle("-fx-font-family : Verdana,Arial,sans-serif;-fx-font-size : 0.8em;");
13846 apPanovisu.getChildren().addAll(ivPanoVisu, lblPanoVisu, lblPanoVisu2);
13847 panePrincipale.getChildren().add(apPanovisu);
13848 panePrincipale.getChildren().add(apWebview);
13849 apWebview.setVisible(false);
13850 apWebview.setStyle("-fx-background-color : #333;");
13851 apWebview.setPrefSize(iLargeur - 75, iHauteur - 80);
13852 apWebview.setMinSize(iLargeur - 75, iHauteur - 80);
13853 apWebview.setMaxSize(iLargeur - 75, iHauteur - 80);
13854 apWebview.setTranslateX(25);
13855 apWebview.setTranslateY(5);
13856 /*
13857 Paramètres de la visite
13858 */
13859 apParametresVisite = new AnchorPane();
13860 apParametresVisite.setLayoutY(40);
13861 Label lblTitreVisite = new Label(rbLocalisation.getString("main.titreVisite"));
13862 lblTitreVisite.setStyle("-fx-font-size : 10pt;-fx-font-weight : bold;");
13863 lblTitreVisite.setLayoutX(10);
13864 lblTitreVisite.setLayoutY(5);
13865
13866 tfTitreVisite = new TextField();
13867 tfTitreVisite.setId("titreVisite");
13868 tfTitreVisite.setPrefSize(200, 25);
13869 tfTitreVisite.setMaxSize(250, 25);
13870 tfTitreVisite.setLayoutX(60);
13871 tfTitreVisite.setLayoutY(25);
13872 cbIntroPetitePlanete = new CheckBox(rbLocalisation.getString("main.introPetitePlanete"));
13873 cbIntroPetitePlanete.setSelected(false);
13874 cbIntroPetitePlanete.setLayoutX(10);
13875 cbIntroPetitePlanete.setLayoutY(60);
13876
13877 Label lblChoixPanoramiqueEntree = new Label(rbLocalisation.getString("main.panoEntree"));
13878 lblChoixPanoramiqueEntree.setStyle("-fx-font-size : 1em;");
13879 lblChoixPanoramiqueEntree.setLayoutX(10);
13880 lblChoixPanoramiqueEntree.setLayoutY(90);
13881 lblChoixPanoramiqueEntree.setMaxWidth(largeurOutils - 40);
13882 lblChoixPanoramiqueEntree.setPrefHeight(35);
13883 lblChoixPanoramiqueEntree.setWrapText(true);
13884
13885 apParametresVisite.setPrefHeight(120);
13886 apParametresVisite.getChildren().addAll(
13888 cbIntroPetitePlanete,
13890 );
13891 PaneOutil poParametresVisite = new PaneOutil(rbLocalisation.getString("main.parametresVisite"), apParametresVisite, largeurOutil);
13892 setApPVIS(new AnchorPane(poParametresVisite.getApPaneOutil()));
13893 poParametresVisite.setbValide(isbIntroPetitePlanete());
13895 apAutoRotation.setPrefHeight(270);
13896 apAutoRotation.setLayoutY(40);
13897 PaneOutil poAutoRotation = new PaneOutil(rbLocalisation.getString("main.autoTourRotation"), apAutoRotation, largeurOutil);
13898 setApAR(new AnchorPane(poAutoRotation.getApPaneOutil()));
13899 poAutoRotation.setbValide(isbAutoRotationDemarre() || isbAutoTourDemarre());
13900
13901 cbAutoRotationDemarrage = new CheckBox(rbLocalisation.getString("main.autoRotationDemarrage"));
13902 cbAutoRotationDemarrage.setSelected(false);
13903 cbAutoRotationDemarrage.setLayoutX(10);
13904 cbAutoRotationDemarrage.setLayoutY(10);
13905
13906 Label lblVitesse = new Label(rbLocalisation.getString("main.autoRotationVitesse"));
13907 lblVitesse.setLayoutX(10);
13908 lblVitesse.setLayoutY(40);
13909 cbAutoRotationVitesse = new ComboBox();
13910 cbAutoRotationVitesse.getItems().add(0, "10 " + rbLocalisation.getString("main.parTour"));
13911 cbAutoRotationVitesse.getItems().add(1, "20 " + rbLocalisation.getString("main.parTour"));
13912 cbAutoRotationVitesse.getItems().add(2, "30 " + rbLocalisation.getString("main.parTour"));
13913 cbAutoRotationVitesse.getItems().add(3, "Autre n " + rbLocalisation.getString("main.parTour"));
13914 cbAutoRotationVitesse.getSelectionModel().select(2);
13915 cbAutoRotationVitesse.setLayoutX(30);
13916 cbAutoRotationVitesse.setLayoutY(70);
13917 cbAutoRotationVitesse.setMaxWidth(170);
13918 bdfAutoRotationVitesse = new BigDecimalField(new BigDecimal(40));
13919 bdfAutoRotationVitesse.setDisable(true);
13920 bdfAutoRotationVitesse.setLayoutX(210);
13921 bdfAutoRotationVitesse.setLayoutY(70);
13922 bdfAutoRotationVitesse.setMaxWidth(70);
13923 lblVitesse.disableProperty().bind(cbAutoRotationDemarrage.selectedProperty().not());
13924 cbAutoRotationVitesse.disableProperty().bind(cbAutoRotationDemarrage.selectedProperty().not());
13925 Label lblUnites = new Label(rbLocalisation.getString("main.parTour"));
13926 lblUnites.setLayoutX(290);
13927 lblUnites.setLayoutY(75);
13928 Separator spAutotour = new Separator(Orientation.HORIZONTAL);
13929 spAutotour.setLayoutX(0);
13930 spAutotour.setLayoutY(100);
13931 spAutotour.setMinWidth(380);
13932
13933 cbAutoTourDemarrage = new CheckBox(rbLocalisation.getString("main.autoTour"));
13934 cbAutoTourDemarrage.setSelected(false);
13935 cbAutoTourDemarrage.setLayoutX(10);
13936 cbAutoTourDemarrage.setLayoutY(120);
13937 Label lblDemarrageAutoTour = new Label(rbLocalisation.getString("main.autoTourDemarrage"));
13938 lblDemarrageAutoTour.setLayoutX(10);
13939 lblDemarrageAutoTour.setLayoutY(150);
13940 bdfAutoTourDemarrage = new BigDecimalField(new BigDecimal(1));
13941 bdfAutoTourDemarrage.setLayoutX(240);
13942 bdfAutoTourDemarrage.setLayoutY(180);
13943 bdfAutoTourDemarrage.setMaxWidth(70);
13944
13945 Label lblVitesseAutoTour = new Label(rbLocalisation.getString("main.autoTourChange"));
13946 lblVitesseAutoTour.setLayoutX(10);
13947 lblVitesseAutoTour.setLayoutY(210);
13948
13949 cbAutoTourType = new ComboBox();
13950 cbAutoTourType.getItems().add(rbLocalisation.getString("main.nTours"));
13951 cbAutoTourType.getItems().add(rbLocalisation.getString("main.nSecondes"));
13952 cbAutoTourType.getSelectionModel().select(1);
13953 cbAutoTourType.setLayoutX(30);
13954 cbAutoTourType.setLayoutY(240);
13955 cbAutoTourType.setMaxWidth(140);
13956 bdfAutoTourLimite = new BigDecimalField(new BigDecimal(1));
13957 bdfAutoTourLimite.setLayoutX(240);
13958 bdfAutoTourLimite.setLayoutY(240);
13959 bdfAutoTourLimite.setMaxWidth(70);
13960 Label lblN = new Label("n=");
13961 lblN.setLayoutX(210);
13962 lblN.setLayoutY(245);
13963 cbAutoTourType.disableProperty().bind(cbAutoTourDemarrage.selectedProperty().not());
13964 bdfAutoTourLimite.disableProperty().bind(cbAutoTourDemarrage.selectedProperty().not());
13965
13966 cbAutoRotationVitesse.getSelectionModel().selectedIndexProperty().addListener((ov, av, nv) -> {
13967 if (cbAutoRotationVitesse.getSelectionModel().getSelectedIndex() == 3) {
13968 bdfAutoRotationVitesse.setDisable(false);
13969 setiAutoRotationVitesse(bdfAutoRotationVitesse.getNumber().toBigInteger().intValue());
13970 } else {
13971 bdfAutoRotationVitesse.setDisable(true);
13972 setiAutoRotationVitesse(10 * (cbAutoRotationVitesse.getSelectionModel().getSelectedIndex() + 1));
13973 }
13974 });
13975 cbIntroPetitePlanete.selectedProperty().addListener((ov, av, nv) -> {
13976 setbIntroPetitePlanete(nv);
13977 poParametresVisite.setbValide(isbIntroPetitePlanete());
13978 });
13979 cbAutoRotationDemarrage.selectedProperty().addListener((ov, av, nv) -> {
13980 setbAutoRotationDemarre(nv);
13981 poAutoRotation.setbValide(isbAutoRotationDemarre() || isbAutoTourDemarre());
13982 });
13983 bdfAutoRotationVitesse.numberProperty().addListener((ov, av, nv) -> {
13984 setiAutoRotationVitesse(nv.toBigInteger().intValue());
13985 });
13986
13987 cbAutoTourType.getSelectionModel().selectedIndexProperty().addListener((ov, av, nv) -> {
13988 if (cbAutoTourType.getSelectionModel().getSelectedIndex() == 0) {
13989 setStrAutoTourType("tours");
13990 } else {
13991 setStrAutoTourType("secondes");
13992 }
13993 });
13994 cbAutoTourDemarrage.selectedProperty().addListener((ov, av, nv) -> {
13995 setbAutoTourDemarre(nv);
13996 poAutoRotation.setbValide(isbAutoRotationDemarre() || isbAutoTourDemarre());
13997 getGestionnaireInterface().getApBtnVA().setDisable(!nv);
13998 });
13999 bdfAutoTourLimite.numberProperty().addListener((ov, av, nv) -> {
14000 setiAutoTourLimite(nv.toBigInteger().intValue());
14001 });
14002 bdfAutoTourDemarrage.numberProperty().addListener((ov, av, nv) -> {
14003 setiAutoTourDemarrage(nv.toBigInteger().intValue());
14004 });
14005
14006 apAutoRotation.getChildren().addAll(
14007 cbAutoRotationDemarrage,
14008 lblVitesse,
14009 cbAutoRotationVitesse, bdfAutoRotationVitesse, lblUnites,
14010 spAutotour,
14011 cbAutoTourDemarrage,
14012 lblDemarrageAutoTour, bdfAutoTourDemarrage,
14014 cbAutoTourType, lblN, bdfAutoTourLimite
14015 );
14016
14018 apParametresPano.setPrefHeight(340);
14019 apParametresPano.setLayoutY(40);
14020 ImageView ivSupprPanoramique = new ImageView(new Image("file:" + getStrRepertAppli() + File.separator + "images/suppr.png", 48, 48, true, true));
14021 ImageView ivModifPanoramique = new ImageView(new Image("file:" + getStrRepertAppli() + File.separator + "images/modifie.png", 48, 48, true, true));
14022 Button btnSupprimePano = new Button(rbLocalisation.getString("main.supprimePanoCourant"), ivSupprPanoramique);
14023 btnSupprimePano.setLayoutX(190);
14024 btnSupprimePano.setLayoutY(70);
14025 btnSupprimePano.setPrefSize(160, 60);
14026 btnSupprimePano.setMinSize(160, 60);
14027 btnSupprimePano.setMaxSize(160, 60);
14028 btnSupprimePano.setWrapText(true);
14029 btnSupprimePano.setOnAction((e) -> {
14030 retirePanoCourant();
14031 });
14032 Button btnModifiePano = new Button(rbLocalisation.getString("main.modifiePanoCourant"), ivModifPanoramique);
14033 btnModifiePano.setLayoutX(20);
14034 btnModifiePano.setLayoutY(70);
14035 btnModifiePano.setPrefSize(160, 60);
14036 btnModifiePano.setMinSize(160, 60);
14037 btnModifiePano.setMaxSize(160, 60);
14038 btnModifiePano.setWrapText(true);
14039 btnModifiePano.setOnAction((e) -> {
14040 String strRepertPano = getPanoramiquesProjet()[getiPanoActuel()].getStrNomFichier().substring(
14041 0, getPanoramiquesProjet()[getiPanoActuel()].getStrNomFichier().lastIndexOf(File.separator));
14043 FileChooser.ExtensionFilter extFilterImage = new FileChooser.ExtensionFilter("Fichiers Image (JPG,BMP,TIFF)", "*.jpg", "*.bmp", "*.tif");
14044 FileChooser.ExtensionFilter extFilterJpeg = new FileChooser.ExtensionFilter("Fichiers JPEG (*.jpg)", "*.jpg");
14045 FileChooser.ExtensionFilter extFilterBmp = new FileChooser.ExtensionFilter("Fichiers BMP (*.bmp)", "*.bmp");
14046 FileChooser.ExtensionFilter extFilterTiff = new FileChooser.ExtensionFilter("Fichiers TIFF (*.tif)", "*.tif");
14047 File fileRepert = new File(strRepertPano + File.separator);
14048 fileChooser.setInitialDirectory(fileRepert);
14049 fileChooser.getExtensionFilters().addAll(extFilterJpeg, extFilterTiff, extFilterBmp, extFilterImage);
14050
14051 File filePano = fileChooser.showOpenDialog(null);
14052 if (filePano != null) {
14053 setbDejaSauve(false);
14054 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14055 String strFilePano = filePano.getAbsolutePath();
14056 String strExtension = strFilePano.substring(strFilePano.length() - 3, strFilePano.length());
14057 Image imgPano = null;
14058 if ("tif".equals(strExtension)) {
14059 try {
14061
14062 } catch (IOException ex) {
14063 Logger.getLogger(EditeurPanovisu.class
14064 .getName()).log(Level.SEVERE, null, ex);
14065 }
14066 } else {
14067 imgPano = new Image("file:" + strFilePano);
14068 }
14069 if (imgPano != null) {
14070 if (imgPano.getWidth() == imgPano.getHeight()) {
14071 try {
14072 rechargePanoramiqueProjet(strFilePano, Panoramique.CUBE);
14073 } catch (InterruptedException ex) {
14074 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
14075 }
14076
14077 } else {
14078 try {
14079 rechargePanoramiqueProjet(strFilePano, Panoramique.SPHERE);
14080 } catch (InterruptedException ex) {
14081 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
14082 }
14083 }
14084 affichePanoChoisit(getiPanoActuel());
14085 if (apListePanoTriable != null) {
14086 apParametresVisite.getChildren().remove(
14087 apListePanoTriable
14088 );
14089 }
14090 ordPano.rafraichitListe();
14091 ordPano.ajouteNouveauxPanos();
14092 apListePanoTriable = ordPano.getApListePanoramiques();
14093 apListePanoTriable.setMaxHeight(apListePanoTriable.getPrefHeight());
14094 apListePanoTriable.setMinHeight(apListePanoTriable.getPrefHeight());
14095 apListePanoTriable.setVisible(true);
14096 apParametresVisite.getChildren().remove(apListePanoTriable);
14097 apParametresVisite.getChildren().add(apListePanoTriable);
14098 apListePanoTriable.setLayoutX(40);
14099 apListePanoTriable.setLayoutY(130);
14100 apParametresVisite.setPrefHeight(120 + apListePanoTriable.getPrefHeight() + 20);
14101 if (apParametresVisite.isVisible()) {
14102 apParametresVisite.setMinHeight(120 + apListePanoTriable.getPrefHeight() + 20);
14103 apParametresVisite.setMaxHeight(120 + apListePanoTriable.getPrefHeight() + 20);
14104 }
14105
14106 rafraichitListePano();
14107
14108 }
14109
14110 }
14111
14112 });
14113 Label lblTitrePano = new Label(rbLocalisation.getString("main.titrePano"));
14114 lblTitrePano.setStyle("-fx-font-size : 1em;");
14115 lblTitrePano.setPadding(new Insets(5, 5, 5, 0));
14116 lblTitrePano.setLayoutX(10);
14117 lblTitrePano.setLayoutY(10);
14118 tfTitrePano = new TextField();
14119 tfTitrePano.setId("txttitrepano");
14120 tfTitrePano.setPrefSize(220, 25);
14121 tfTitrePano.setMaxSize(250, 25);
14122 tfTitrePano.setLayoutX(60);
14123 tfTitrePano.setLayoutY(40);
14124
14125 tfTitrePano.textProperty().addListener((final ObservableValue<? extends String> observable, final String oldValue, final String newValue) -> {
14126 clickBtnValidePano();
14127 });
14128
14129 slMinLat = new Slider(-90, -45, -90);
14130 slMinLat.setDisable(true);
14131 slMaxLat = new Slider(45, 90, 90);
14132 slMaxLat.setDisable(true);
14133 cbMinLat = new CheckBox(rbLocalisation.getString("main.blocageNadir"));
14134 cbMaxLat = new CheckBox(rbLocalisation.getString("main.blocageZenith"));
14135 slMinFov = new Slider(5, 70, 12);
14136 slMaxFov = new Slider(5, 70, 70);
14137 Label lblMinFov = new Label("min. hFOV : 12°");
14138 Label lblMaxFov = new Label("max. hFOV : 70°");
14139 slMinLat.disableProperty().bind(cbMinLat.selectedProperty().not());
14140 slMaxLat.disableProperty().bind(cbMaxLat.selectedProperty().not());
14141 slMinLat.setLayoutX(10);
14142 slMinLat.setLayoutY(160);
14143 cbMinLat.setLayoutX(190);
14144 cbMinLat.setLayoutY(160);
14145 slMaxLat.setLayoutX(10);
14146 slMaxLat.setLayoutY(190);
14147 cbMaxLat.setLayoutX(190);
14148 cbMaxLat.setLayoutY(190);
14149 slMinFov.setLayoutX(10);
14150 slMinFov.setLayoutY(220);
14151 lblMinFov.setLayoutX(190);
14152 lblMinFov.setLayoutY(220);
14153 slMaxFov.setLayoutX(10);
14154 slMaxFov.setLayoutY(250);
14155 lblMaxFov.setLayoutX(190);
14156 lblMaxFov.setLayoutY(250);
14157 Button btnBlocage = new Button(rbLocalisation.getString("main.blocage"));
14158 btnBlocage.setLayoutX(190);
14159 btnBlocage.setLayoutY(300);
14160 ligNadir = new Line();
14161 ligNadir.setVisible(false);
14162 ligNadir.setStroke(Color.YELLOW);
14163 ligNadir.setStrokeWidth(2);
14164 ligZenith = new Line();
14165 ligZenith.setVisible(false);
14166 ligZenith.setStroke(Color.YELLOW);
14167 ligZenith.setStrokeWidth(2);
14168 ligNadir.visibleProperty().bind(cbMinLat.selectedProperty());
14169 ligZenith.visibleProperty().bind(cbMaxLat.selectedProperty());
14170
14171 slMinFov.valueProperty().addListener((observableValue, oldValue, newValue) -> {
14172 setbDejaSauve(false);
14173 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14174
14175 getPanoramiquesProjet()[getiPanoActuel()].setFovMin((double) newValue);
14176 double val1 = Math.round((double) newValue * 10) / 10;
14177 lblMinFov.setText("min. FOV : " + val1 + "°");
14178 slMaxFov.setMin(val1);
14179 navigateurPanoramique.setMinFov(val1);
14180 if (navigateurPanoramique.getFov() < val1) {
14181 navigateurPanoramique.setFov(val1);
14182
14183 }
14184 if (navigateurPanoramique.getChoixFov()<val1){
14185 navigateurPanoramique.setChoixFov(val1);
14186 }
14187 });
14188
14189 slMaxFov.valueProperty().addListener((observableValue, oldValue, newValue) -> {
14190 setbDejaSauve(false);
14191 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14192
14193 getPanoramiquesProjet()[getiPanoActuel()].setFovMax((double) newValue);
14194 double val1 = Math.round((double) newValue * 10) / 10;
14195 lblMaxFov.setText("max. FOV : " + val1 + "°");
14196 slMinFov.setMax(val1);
14197 navigateurPanoramique.setMaxFov(val1);
14198 if (navigateurPanoramique.getFov() > val1) {
14199 navigateurPanoramique.setFov(val1);
14200 }
14201 if (navigateurPanoramique.getChoixFov()>val1){
14202 navigateurPanoramique.setChoixFov(val1);
14203 }
14204 });
14205
14206 slMinLat.valueProperty().addListener((observableValue, oldValue, newValue) -> {
14207 setbDejaSauve(false);
14208 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14209
14210 double largeurImage1 = panePanoramique.getPrefWidth();
14211 double X11 = ivImagePanoramique.getLayoutX();
14212 double Y1 = (90.0d - (double) newValue) * largeurImage1 / 360.0d;
14213 ligNadir.setStartX(X11);
14214 ligNadir.setStartY(Y1);
14215 ligNadir.setEndX(X11 + largeurImage1);
14216 ligNadir.setEndY(Y1);
14217 getPanoramiquesProjet()[iPanoActuel].setMinLat((double) newValue);
14218 });
14219
14220 slMaxLat.valueProperty().addListener((observableValue, oldValue, newValue) -> {
14221 setbDejaSauve(false);
14222 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14223
14224 double largeurImage1 = panePanoramique.getPrefWidth();
14225 double X11 = ivImagePanoramique.getLayoutX();
14226 double Y1 = (90.0d - (double) newValue) * largeurImage1 / 360.0d;
14227 ligZenith.setStartX(X11);
14228 ligZenith.setStartY(Y1);
14229 ligZenith.setEndX(X11 + largeurImage1);
14230 ligZenith.setEndY(Y1);
14231 getPanoramiquesProjet()[iPanoActuel].setMaxLat((double) newValue);
14232 });
14233
14234 cbMinLat.selectedProperty().addListener((ov, av, nv) -> {
14235 setbDejaSauve(false);
14236 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14237
14238 double largeurImage1 = panePanoramique.getPrefWidth();
14239 double X11 = ivImagePanoramique.getLayoutX();
14240 double Y1 = (90.0d - (double) slMinLat.getValue()) * largeurImage1 / 360.0d;
14241 ligNadir.setStartX(X11);
14242 ligNadir.setStartY(Y1);
14243 ligNadir.setEndX(X11 + largeurImage1);
14244 ligNadir.setEndY(Y1);
14245 getPanoramiquesProjet()[iPanoActuel].setbMinLat(nv);
14246 });
14247
14248 cbMaxLat.selectedProperty().addListener((ov, av, nv) -> {
14249 setbDejaSauve(false);
14250 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14251
14252 double largeurImage1 = panePanoramique.getPrefWidth();
14253 double X11 = ivImagePanoramique.getLayoutX();
14254 double Y1 = (90.0d - (double) (double) slMaxLat.getValue()) * largeurImage1 / 360.0d;
14255 ligZenith.setStartX(X11);
14256 ligZenith.setStartY(Y1);
14257 ligZenith.setEndX(X11 + largeurImage1);
14258 ligZenith.setEndY(Y1);
14259 getPanoramiquesProjet()[iPanoActuel].setbMaxLat(nv);
14260 });
14261
14262 btnBlocage.setOnAction((e) -> {
14263 setbDejaSauve(false);
14264 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14265
14266 for (int i = 0; i < iNombrePanoramiques; i++) {
14267 getPanoramiquesProjet()[i].setbMaxLat(getPanoramiquesProjet()[iPanoActuel].isbMaxLat());
14268 getPanoramiquesProjet()[i].setbMinLat(getPanoramiquesProjet()[iPanoActuel].isbMinLat());
14269 getPanoramiquesProjet()[i].setMaxLat(getPanoramiquesProjet()[iPanoActuel].getMaxLat());
14270 getPanoramiquesProjet()[i].setMinLat(getPanoramiquesProjet()[iPanoActuel].getMinLat());
14271 getPanoramiquesProjet()[i].setFovMax(getPanoramiquesProjet()[iPanoActuel].getFovMax());
14272 getPanoramiquesProjet()[i].setFovMin(getPanoramiquesProjet()[iPanoActuel].getFovMin());
14273 }
14274 });
14275
14276 apParametresPano.getChildren().addAll(
14280 slMaxLat, cbMaxLat,
14281 slMinLat, cbMinLat,
14282 slMinFov, lblMinFov,
14283 slMaxFov, lblMaxFov,
14285 );
14286
14287 setApPPAN(new AnchorPane(new PaneOutil(true, rbLocalisation.getString("main.parametresPano"), apParametresPano, largeurOutil).getApPaneOutil()));
14288
14289 // Panneau Description IA
14291 apDescriptionIA.setPrefHeight(250);
14292 apDescriptionIA.setLayoutY(40);
14293
14294 Label lblDescriptionIA = new Label(rbLocalisation.getString("main.descriptionIA"));
14295 lblDescriptionIA.setStyle("-fx-font-size : 1em;");
14296 lblDescriptionIA.setPadding(new Insets(5, 5, 5, 0));
14297 lblDescriptionIA.setLayoutX(10);
14298 lblDescriptionIA.setLayoutY(10);
14299
14301 taDescriptionIA.setId("txtDescriptionIA");
14302 taDescriptionIA.setPrefSize(330, 150);
14303 taDescriptionIA.setLayoutX(10);
14304 taDescriptionIA.setLayoutY(40);
14305 taDescriptionIA.setWrapText(true);
14306 taDescriptionIA.setPromptText(rbLocalisation.getString("main.descriptionIAPlaceholder"));
14307
14308 // Listener pour sauvegarder la description quand elle est modifiée
14309 taDescriptionIA.textProperty().addListener((observable, oldValue, newValue) -> {
14310 if (getPanoramiquesProjet() != null && getiPanoActuel() >= 0 && getiPanoActuel() < getiNombrePanoramiques()) {
14311 getPanoramiquesProjet()[getiPanoActuel()].setStrDescriptionIA(newValue);
14312 setbDejaSauve(false);
14313 getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
14314 }
14315 });
14316
14317 // Avertissement sur la vérification des informations IA (agrandi pour meilleure visibilité)
14318 Label lblAvertissementIA = new Label(rbLocalisation.getString("main.descriptionIAAvertissement"));
14319 lblAvertissementIA.setLayoutX(10);
14320 lblAvertissementIA.setLayoutY(195);
14321 lblAvertissementIA.setPrefWidth(330);
14322 lblAvertissementIA.setWrapText(true);
14323 lblAvertissementIA.setStyle("-fx-font-size: 12px; -fx-text-fill: #FF8C00; -fx-font-style: italic; -fx-font-weight: bold;");
14324
14325 Button btnGenererIA = new Button(rbLocalisation.getString("main.genererDescriptionIA"));
14326 btnGenererIA.setLayoutX(10);
14327 btnGenererIA.setLayoutY(220);
14328 btnGenererIA.setPrefSize(160, 30);
14329 btnGenererIA.setOnAction((e) -> {
14330 genererDescriptionIA(taDescriptionIA);
14331 });
14332
14333 // ToggleSwitch pour basculer entre OpenRouter (online) et Ollama (offline)
14334 Label lblModeIA = new Label("Mode IA:");
14335 lblModeIA.setLayoutX(180);
14336 lblModeIA.setLayoutY(220);
14337 lblModeIA.setStyle("-fx-font-size: 11px;");
14338
14340 toggleModeIA.setLayoutX(240);
14341 toggleModeIA.setLayoutY(218);
14342 toggleModeIA.setPrefSize(90, 30);
14343
14344 // État initial basé sur la disponibilité OpenRouter
14346 toggleModeIA.setSelected(!openRouterDispo); // Si OpenRouter dispo, on commence en mode online (not selected)
14347
14348 // Mettre à jour le texte du bouton
14349 if (toggleModeIA.isSelected()) {
14350 toggleModeIA.setText("🔸 Offline");
14351 toggleModeIA.setStyle("-fx-background-color: #4A90E2; -fx-text-fill: white;");
14353 } else {
14354 toggleModeIA.setText("🌐 Online");
14355 toggleModeIA.setStyle("-fx-background-color: #2ECC71; -fx-text-fill: white;");
14357 }
14358
14359 // Listener pour changer de mode
14360 toggleModeIA.selectedProperty().addListener((obs, oldVal, newVal) -> {
14361 if (newVal) {
14362 // Mode Offline (Ollama)
14363 toggleModeIA.setText("🔸 Offline");
14364 toggleModeIA.setStyle("-fx-background-color: #4A90E2; -fx-text-fill: white;");
14366 System.out.println("[IA] 🔸 Mode basculé: Ollama (offline)");
14367 } else {
14368 // Mode Online (OpenRouter)
14369 toggleModeIA.setText("🌐 Online");
14370 toggleModeIA.setStyle("-fx-background-color: #2ECC71; -fx-text-fill: white;");
14372 System.out.println("[IA] 🌐 Mode basculé: OpenRouter (online)");
14373 }
14374 });
14375
14377
14378 setApDESCIA(new AnchorPane(new PaneOutil(true, rbLocalisation.getString("main.descriptionIA"), apDescriptionIA, largeurOutil).getApPaneOutil()));
14379
14380 setApGEO(new AnchorPane());
14381 apOpenLayers = new AnchorPane();
14382 apOpenLayers.setVisible(false);
14383 apOpenLayers.getStyleClass().add("dialog-content-pane");
14384 if (isbInternet()) {
14385 navigateurOpenLayers = new NavigateurOpenLayers();
14386 navigateurOpenLayers.setBingApiKey(getStrBingAPIKey());
14387 tfLongitude = new TextField();
14388 tfLatitude = new TextField();
14389 apOpenLayers = navigateurOpenLayers.afficheNavigateurOpenLayer(tfLongitude, tfLatitude, true);
14390 apOpenLayers.setPrefSize(900, 650); // Taille fixe - pas de redimensionnement
14391 apOpenLayers.setMinSize(900, 650); // Empêcher le redimensionnement
14392 apOpenLayers.setMaxSize(900, 650); // Empêcher le redimensionnement
14393 Button btnGeolocalise = new Button(rbLocalisation.getString("main.geolocalisation"));
14394
14395 btnGeolocalise.setLayoutX(10);
14396 btnGeolocalise.setLayoutY(25);
14397 btnGeolocalise.setPrefWidth(120);
14398
14399 // Désactiver le bouton géolocalisation si pas d'Internet
14400 if (!isbInternet()) {
14401 btnGeolocalise.setDisable(true);
14402 btnGeolocalise.setTooltip(new Tooltip("Géolocalisation indisponible sans connexion Internet"));
14403 }
14404
14405 btnGeolocalise.setOnAction((e) -> {
14406 // ⚠️ LAZY LOADING: Initialiser NavigateurCarte au premier clic
14407 navigateurOpenLayers.ensureNavigateurCarteInitialized();
14408
14409 // Afficher la fenêtre immédiatement
14410 apOpenLayers.setVisible(true);
14411
14412 // Attendre que la carte soit chargée (bDebut = true) avant de positionner
14413 new Thread(() -> {
14414 int maxAttempts = 50; // Max 5 secondes (50 x 100ms)
14415 int attempts = 0;
14416 while (!navigateurOpenLayers.isbDebut() && attempts < maxAttempts) {
14417 try {
14418 Thread.sleep(100);
14419 attempts++;
14421 break;
14422 }
14423 }
14424
14425 // Une fois la carte chargée, positionner le marqueur sur le thread JavaFX
14426 if (navigateurOpenLayers.isbDebut()) {
14427 Platform.runLater(() -> {
14428 navigateurOpenLayers.retireMarqueur(0);
14429 if (navigateurOpenLayers.getBingApiKey().equals("")) {
14430 navigateurOpenLayers.afficheCartesOpenlayer();
14431 } else {
14432 navigateurOpenLayers.valideBingApiKey(navigateurOpenLayers.getBingApiKey());
14433 }
14434
14435 if (panoramiquesProjet[getiPanoActuel()].getMarqueurGeolocatisation() != null) {
14436 CoordonneesGeographiques coords = panoramiquesProjet[getiPanoActuel()].getMarqueurGeolocatisation();
14437 System.out.println("📍 Positionnement sur coordonnées: " + coords.getLatitude() + ", " + coords.getLongitude());
14438 navigateurOpenLayers.allerCoordonnees(coords, 17);
14439 navigateurOpenLayers.setMarqueur(coords);
14440
14441 String strFichierPano = getPanoramiquesProjet()[getiPanoActuel()]
14442 .getStrNomFichier().substring(getPanoramiquesProjet()[getiPanoActuel()].getStrNomFichier()
14443 .lastIndexOf(File.separator) + 1, getPanoramiquesProjet()[getiPanoActuel()]
14444 .getStrNomFichier().length()).split("\\.")[0];
14445 String strHTML = "<span style='font-family : Verdana,Arial,sans-serif;font-weight:bold;font-size : 12px;'>"
14446 + getPanoramiquesProjet()[getiPanoActuel()].getStrTitrePanoramique()
14447 + "</span><br/>"
14448 + "<span style='font-family : Verdana,Arial,sans-serif;bold;font-size : 10px;'>"
14449 + strFichierPano
14450 + "</span>";
14451 strHTML = strHTML.replace("\\", "/");
14452 navigateurOpenLayers.ajouteMarqueur(0, coords, strHTML);
14453 } else {
14454 System.out.println("📍 Pas de coordonnées préexistantes - carte centrée par défaut");
14455 }
14456 });
14457 }
14458 }).start();
14459 });
14460 // Labels pour les coordonnées
14461 Label lblLatitude = new Label("Latitude:");
14462 lblLatitude.setLayoutX(140);
14463 lblLatitude.setLayoutY(10);
14464 lblLatitude.setPrefWidth(60);
14465 lblLatitude.setStyle("-fx-font-weight: bold;");
14466
14467 Label lblLongitude = new Label("Longitude:");
14468 lblLongitude.setLayoutX(140);
14469 lblLongitude.setLayoutY(40);
14470 lblLongitude.setPrefWidth(70);
14471 lblLongitude.setStyle("-fx-font-weight: bold;");
14472
14473 tfLatitude.setLayoutX(210);
14474 tfLatitude.setLayoutY(10);
14475 tfLatitude.setPrefWidth(150);
14476 tfLatitude.setPromptText("Latitude (ex: 48°51'29.6\"N)");
14477
14478 tfLongitude.setLayoutX(210);
14479 tfLongitude.setLayoutY(40);
14480 tfLongitude.setPrefWidth(150);
14481 tfLongitude.setPromptText("Longitude (ex: 2°17'30.5\"E)");
14482
14483 apOpenLayers.setLayoutX(200);
14484 apOpenLayers.setLayoutY(150);
14485 apOpenLayers.setVisible(false);
14487 apGeolocalise.setPrefHeight(75);
14488 apGeolocalise.getChildren().addAll(btnGeolocalise, lblLatitude, tfLatitude, lblLongitude, tfLongitude);
14489 apGeolocalise.setLayoutX(10);
14490 apGeolocalise.setLayoutY(40);
14491 setPoGeolocalisation(new PaneOutil(rbLocalisation.getString("main.geolocalisation"), apGeolocalise, largeurOutil));
14492 setApGEO(new AnchorPane(getPoGeolocalisation().getApPaneOutil()));
14493
14494 apOpenLayers.setLayoutX((iLargeur - apOpenLayers.getPrefWidth()) / 2);
14495 apOpenLayers.setLayoutY((iHauteur - apOpenLayers.getPrefHeight()) / 2);
14496 apOpenLayers.visibleProperty().addListener((ov, av, nv) -> {
14497 mbarPrincipal.setDisable(nv);
14498 hbBarreBouton.setDisable(nv);
14499 tpEnvironnement.setDisable(nv);
14500
14501 });
14502 }
14503
14504 apVisuPanoramique.setLayoutY(40);
14505 apVisuPanoramique.setPrefWidth(340);
14506 apVisuPanoramique.setPrefHeight(295);
14507
14508 setApVISU(new AnchorPane(new PaneOutil(true, rbLocalisation.getString("main.visualisation"), apVisuPanoramique, largeurOutil).getApPaneOutil()));
14509
14510 vbVisuHotspots = new VBox();
14511
14512 // Pas de ScrollPane interne - utilise le ScrollPane parent (spPanneauOutils)
14513 // pour éviter le double système d'ascenseur
14514 apVisuHS = new AnchorPane(vbVisuHotspots);
14515 apVisuHS.setLayoutY(40);
14516 apHS1 = new PaneOutil(true, "Hotspots", apVisuHS, largeurOutil);
14517
14518 setApHS(new AnchorPane(apHS1.getApPaneOutil()));
14519
14520 getVbChoixPanoramique().getChildren().addAll(getApPVIS(), getApAR(), getApPPAN(), getApDESCIA(), getApGEO(), getApVISU(), getApHS());
14521 getVbChoixPanoramique().setSpacing(-5);
14522 vbOutils.getChildren().addAll(getVbChoixPanoramique());
14523 getVbChoixPanoramique().setVisible(false);
14524 /*
14525 Création du panneau d'info du panoramique
14526 */
14527
14528 spVuePanoramique = new ScrollPane();
14529
14530 hbCoordonnees = new HBox();
14531 panePanoramique = new Pane();
14532 apPanneauPrincipal = new AnchorPane();
14533 lblLong = new Label("");
14534 lblLat = new Label("");
14535 ivImagePanoramique = new ImageView();
14536
14537 stPrimaryStage.setScene(getScnPrincipale());
14538
14542 spVuePanoramique.setPrefSize(iLargeur - largeurOutils - 20, iHauteur - 110);
14543 spVuePanoramique.setMaxSize(iLargeur - largeurOutils - 20, iHauteur - 110);
14544 spVuePanoramique.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
14545 spVuePanoramique.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
14546 spVuePanoramique.setTranslateY(5);
14551 apPanneauOutils.getChildren().addAll(spPanneauOutils);
14552 apPanneauOutils.setTranslateY(3);
14553 apPanneauOutils.setTranslateX(20);
14554 spPanneauOutils.setContent(vbOutils);
14555 spPanneauOutils.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
14556 spPanneauOutils.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
14557 spPanneauOutils.setPrefSize(largeurOutils, iHauteur - 112);
14558 spPanneauOutils.setMaxWidth(largeurOutils);
14559 spPanneauOutils.setMaxHeight(iHauteur - 112);
14560 spPanneauOutils.setLayoutY(0);
14561 spPanneauOutils.setLayoutX(0);
14565 panePanoramique.setCursor(Cursor.CROSSHAIR);
14566 vbOutils.setPrefWidth(largeurOutils - 20);
14567 vbOutils.minHeight(iHauteur - 110);
14568 vbOutils.setLayoutX(3);
14569 lblLong.setPrefSize(100, 15);
14570 lblLat.setPrefSize(100, 15);
14571 lblLat.setTranslateX(50);
14572 apPanneauPrincipal.setPrefSize(iLargeur - largeurOutils - 20, iHauteur - 110);
14573 apListeImagesPanoramiques = new AnchorPane();
14574 apListeImagesPanoramiques.getStyleClass().add("dialog-content-pane");
14575 apListeImagesPanoramiques.setPrefWidth(iLargeurVignettes + 40);
14576 apListeImagesPanoramiques.setMinWidth(iLargeurVignettes + 40);
14577 apListeImagesPanoramiques.setMaxWidth(iLargeurVignettes + 40);
14578 apListeImagesPanoramiques.setPrefHeight(iHauteur - 140);
14579 apListeImagesPanoramiques.setLayoutX(-iLargeurVignettes - 30);
14580 apListeImagesPanoramiques.setLayoutY(0);
14581 //apListeImagesPanoramiques.setStyle("-fx-background-color:-fx-base;");
14582 apListeImagesPanoramiques.setOnMouseEntered((e) -> {
14583 apListeImagesPanoramiques.setLayoutX(0);
14584 });
14585 apListeImagesPanoramiques.setOnMouseExited((e) -> {
14586 apListeImagesPanoramiques.setLayoutX(-iLargeurVignettes - 30);
14587 });
14588 Label lblVignettes = new Label(rbLocalisation.getString("main.vignettes"));
14589
14590 lblVignettes.setPrefSize(70, 20);
14591 lblVignettes.setTextAlignment(TextAlignment.CENTER);
14592 lblVignettes.getStyleClass().add("dialog-content-pane");
14593 lblVignettes.setTranslateX(-lblVignettes.getPrefWidth() / 2 + lblVignettes.getPrefHeight() / 2);
14594 lblVignettes.setTranslateY(lblVignettes.getPrefWidth() / 2 - lblVignettes.getPrefHeight() / 2);
14595 lblVignettes.setRotate(270);
14596 lblVignettes.setLayoutX(iLargeurVignettes + 30);
14597 apVignettesPano = new AnchorPane();
14598 apVignettesPano.setPrefWidth(iLargeurVignettes + 10);
14599 apVignettesPano.setMinHeight(iHauteur - 140);
14600 apVignettesPano.setStyle("-fx-background-color:-fx-base;");
14601 rectVignettePano = new Rectangle(0, 0, iLargeurVignettes, iLargeurVignettes / 2.d);
14602 rectVignettePano.setLayoutX(5);
14603 rectVignettePano.setLayoutY(10);
14604 rectVignettePano.setFill(Color.web("#fff", 0.5));
14605 rectVignettePano.setStroke(Color.WHITE);
14606 rectVignettePano.setStrokeWidth(2.0);
14607 rectVignettePano.setVisible(false);
14608 apVignettesPano.getChildren().add(rectVignettePano);
14609 ScrollPane spListeImagesPanoramiques = new ScrollPane(apVignettesPano);
14610 spListeImagesPanoramiques.setPrefWidth(iLargeurVignettes + 30);
14611 spListeImagesPanoramiques.setPrefHeight(iHauteur - 130);
14612 spListeImagesPanoramiques.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
14613 spListeImagesPanoramiques.setStyle("-fx-background-color:-fx-base;"
14614 + "-fx-border-color: derive(-fx-base,10%);"
14615 + "-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.2) , 8, 0.0 , 0 , 8 );"
14616 + "-fx-border-width: 1px;");
14617 apListeImagesPanoramiques.getChildren().addAll(spListeImagesPanoramiques, lblVignettes);
14618
14619 ivImagePanoramique.setCache(true);
14620 largeur = largeurMax - 60;
14621 ivImagePanoramique.setFitWidth(largeur);
14622 ivImagePanoramique.setFitHeight(largeur / 2.0d);
14623 ivImagePanoramique.setLayoutX((largeurMax - largeur) / 2.d);
14624 panePanoramique.getChildren().add(ivImagePanoramique);
14625 panePanoramique.setPrefSize(ivImagePanoramique.getFitWidth(), ivImagePanoramique.getFitHeight());
14626 panePanoramique.setMaxSize(ivImagePanoramique.getFitWidth(), ivImagePanoramique.getFitHeight());
14627
14628 panePanoramique.setLayoutY(20);
14629 lblLong.setTranslateX(50);
14630 lblLat.setTranslateX(80);
14631 hbCoordonnees.getChildren().setAll(lblLong, lblLat);
14632 spVuePanoramique.setContent(apPanneauPrincipal);
14633 hbEnvironnement.getChildren().setAll(spVuePanoramique, apPanneauOutils);
14634 apEnvironnement = new AnchorPane();
14635 apEnvironnement.getStyleClass().add("dialog-content-pane");
14636
14637 setApAttends(new AnchorPane());
14638 getApAttends().getStyleClass().add("dialog-content-pane");
14639 getApAttends().setPrefHeight(250);
14640 getApAttends().setPrefWidth(600);
14641 getApAttends().setMaxWidth(600);
14642 getApAttends().setStyle("-fx-border-color: derive(-fx-base,10%);"
14643 + "-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.5) , 8, 0.0 , 0 , 8 );"
14644 + "-fx-border-width: 1px;");
14645 getApAttends().setLayoutX((iLargeur - getApAttends().getPrefWidth()) / 2.d);
14646 getApAttends().setLayoutY((iHauteur - getApAttends().getPrefHeight()) / 2.d - 55);
14647 pbarAvanceChargement = new ProgressBar();
14648 pbarAvanceChargement.setPrefSize(400, 30);
14649 pbarAvanceChargement.setLayoutX((getApAttends().getPrefWidth() - pbarAvanceChargement.getPrefWidth()) / 2);
14650 pbarAvanceChargement.setLayoutY(70);
14651 Label lblAttends = new Label(rbLocalisation.getString("main.attendsChargement"));
14652 lblAttends.setMinWidth(600);
14653 lblAttends.setAlignment(Pos.CENTER);
14654 lblAttends.setStyle("-fx-background-color : #777;");
14655 lblAttends.setTextFill(Color.WHITE);
14656 lblAttends.setLayoutY(5);
14657 lblAttends.setFont(Font.font(14));
14658 lblCharge = new Label();
14659 lblCharge.setMinWidth(600);
14660 lblCharge.setLayoutY(150);
14661 lblCharge.setAlignment(Pos.CENTER);
14662 lblNiveaux = new Label();
14663 lblNiveaux.setMinWidth(600);
14664 lblNiveaux.setLayoutY(180);
14665 lblNiveaux.setAlignment(Pos.CENTER);
14666 getApAttends().getChildren().addAll(lblAttends, pbarAvanceChargement, lblCharge, lblNiveaux);
14667 getApAttends().setVisible(false);
14668 apEnvironnement.getChildren().addAll(tpEnvironnement, getApAttends());
14669 if (isMac()) {
14670 apEnvironnement.setTranslateY(-30);
14671 }
14672 vbRacine.getChildren().addAll(apEnvironnement);
14673 apPanneauPrincipal.getChildren().setAll(hbCoordonnees, panePanoramique);
14674 stPrimaryStage.show();
14675 popUp.affichePopup();
14676 lblDragDrop = new Label(rbLocalisation.getString("main.dragDrop"));
14677 lblDragDrop.setMinHeight(spVuePanoramique.getPrefHeight());
14678 lblDragDrop.setMaxHeight(spVuePanoramique.getPrefHeight());
14679 lblDragDrop.setMinWidth(spVuePanoramique.getPrefWidth());
14680 lblDragDrop.setMaxWidth(spVuePanoramique.getPrefWidth());
14681 lblDragDrop.setAlignment(Pos.CENTER);
14682 lblDragDrop.setTextFill(Color.web("#c9c7c7"));
14683 lblDragDrop.setTextAlignment(TextAlignment.CENTER);
14684 lblDragDrop.setWrapText(true);
14685 lblDragDrop.setStyle("-fx-font-size:72px");
14686 lblDragDrop.setTranslateY(-100);
14687
14688 apLoupe.setLayoutX(35);
14689 apLoupe.setLayoutY(35);
14690 apLoupe.setVisible(false);
14691
14692 apPanneauPrincipal.getChildren().addAll(lblDragDrop, spAfficheLegende(), apLoupe, apListeImagesPanoramiques);
14693
14694 apCreationBarre = new AnchorPane();
14695 apCreationBarre.setVisible(false);
14696 apCreationDiaporama = new AnchorPane();
14697 apCreationDiaporama.setVisible(false);
14698 apEnvironnement.getChildren().addAll(apCreationBarre, apCreationDiaporama, apOpenLayers);
14699 }
14700
14701 private static void lisPreferences() throws IOException {
14702 File fileFichPreferences = new File(fileRepertConfig.getAbsolutePath() + File.separator + "preferences.cfg");
14703 if (fileFichPreferences.exists()) {
14704 try {
14707 new FileInputStream(fileFichPreferences), "UTF-8"))) {
14708 while ((strTexte = FichierConfig.readLine()) != null) {
14709 String tpe = strTexte.split("=")[0];
14710 String valeur;
14711 if (strTexte.split("=").length > 1) {
14712 valeur = strTexte.split("=")[1];
14713 } else {
14714 valeur = "";
14715 }
14716 switch (tpe) {
14717 case "typeFichiersTransf":
14718 setStrTypeFichierTransf(valeur);
14719 break;
14720 case "tailleLoupe":
14721 setiTailleLoupe(Integer.parseInt(valeur));
14722 break;
14723 case "afficheLoupe":
14724 setAfficheLoupe(valeur.equals("true"));
14725 break;
14726 case "largeurE2C":
14727 setLargeurE2C(Double.parseDouble(valeur));
14728 break;
14729 case "hauteurE2C":
14730 setHauteurE2C(Double.parseDouble(valeur));
14731 break;
14732 case "netteteTransf":
14733 setbNetteteTransf(valeur.equals("true"));
14734 break;
14735 case "niveauNetteteTransf":
14736 setNiveauNetteteTransf(Double.parseDouble(valeur));
14737 break;
14738 case "dernierRepertoireVisite":
14739 setStrDernierRepertoireVisite(valeur);
14740 break;
14741 case "dernierRepertoireImages":
14742 setStrDernierRepertoireImages(valeur);
14743 break;
14744 case "openrouterModel":
14745 if (!valeur.isEmpty()) {
14747 System.out.println("[Config] 🤖 Modèle OpenRouter chargé: " + valeur);
14748 }
14749 break;
14750 case "ollamaModel":
14751 if (!valeur.isEmpty()) {
14753 System.out.println("[Config] 🤖 Modèle Ollama chargé: " + valeur);
14754 }
14755 break;
14756 case "gpuEnabled":
14757 boolean gpuEnabled = valeur.equals("true");
14759 System.out.println("[Config] 🎮 GPU " + (gpuEnabled ? "activé" : "désactivé"));
14760 break;
14761 }
14762
14763 }
14764
14765 }
14766
14767 } catch (FileNotFoundException ex) {
14768 Logger.getLogger(EditeurPanovisu.class
14769 .getName()).log(Level.SEVERE, null, ex);
14770 }
14771
14772 }
14773 }
14774
14780 public static void sauvePreferences() throws IOException {
14781 File fileFichPreferences = new File(EditeurPanovisu.fileRepertConfig.getAbsolutePath() + File.separator + "preferences.cfg");
14782 if (!fileFichPreferences.exists()) {
14783 fileFichPreferences.createNewFile();
14784 }
14785 fileFichPreferences.setWritable(true);
14786 String strContenuFichier = "typeFichiersTransf=" + getStrTypeFichierTransf() + "\n";
14787 strContenuFichier += "tailleLoupe=" + getiTailleLoupe() + "\n";
14788 strContenuFichier += "afficheLoupe=" + isAfficheLoupe() + "\n";
14789 strContenuFichier += "largeurE2C=" + getLargeurE2C() + "\n";
14790 strContenuFichier += "hauteurE2C=" + getHauteurE2C() + "\n";
14791 strContenuFichier += "netteteTransf=" + isbNetteteTransf() + "\n";
14792 strContenuFichier += "niveauNetteteTransf=" + getNiveauNetteteTransf() + "\n";
14793 strContenuFichier += "dernierRepertoireVisite=" + getStrDernierRepertoireVisite() + "\n";
14794 strContenuFichier += "dernierRepertoireImages=" + getStrDernierRepertoireImages() + "\n";
14797 try {
14799
14800 } catch (IOException ex) {
14801 Logger.getLogger(ConfigDialogController.class
14802 .getName()).log(Level.SEVERE, null, ex);
14803 }
14805 try {
14807
14808 } catch (IOException ex) {
14809 Logger.getLogger(ConfigDialogController.class
14810 .getName()).log(Level.SEVERE, null, ex);
14811 }
14812 try {
14813 bwFichierHisto.close();
14814
14815 } catch (IOException ex) {
14816 Logger.getLogger(ConfigDialogController.class
14817 .getName()).log(Level.SEVERE, null, ex);
14818 }
14819
14820 }
14821
14845 @Override
14846 public void start(Stage stPrimaryStage) throws Exception {
14847 // Réinitialiser le serveur HTTP au démarrage pour libérer les ports
14848 try {
14850 System.out.println("✅ Serveur HTTP réinitialisé au démarrage");
14851 } catch (Exception e) {
14852 System.err.println("⚠️ Erreur lors de la réinitialisation du serveur HTTP : " + e.getMessage());
14853 }
14854
14855 // Initialiser le GPU au démarrage pour afficher les informations
14856 try {
14858 if (!gpuManager.isGPUAvailable()) {
14859 System.out.println("[GPU] ℹ️ Aucun GPU OpenCL détecté - Les transformations utiliseront le CPU");
14860 }
14861 } catch (Exception e) {
14862 System.out.println("[GPU] ⚠️ Erreur lors de l'initialisation GPU : " + e.getMessage());
14863 }
14864
14865 if (isLinux()) {
14866 stPrimaryStage.setFullScreen(true);
14867 }
14868 File fileRep = new File("");
14869 setbInternet(netIsAvailable());
14870 setStrCurrentDir(fileRep.getAbsolutePath());
14871 setStrRepertAppli(fileRep.getAbsolutePath());
14872 fileRepertConfig = new File(getStrRepertAppli() + File.separator + "configPV");
14873 rbLocalisation = ResourceBundle.getBundle("editeurpanovisu.i18n.PanoVisu", getLocale());
14874 // Lire la version depuis project.properties
14875 String version = "3.3";
14876 try {
14878 java.io.InputStream is = getClass().getResourceAsStream("/project.properties");
14879 if (is != null) {
14880 propVersion.load(is);
14881 version = propVersion.getProperty("project.version", "3.1");
14882 is.close();
14883 }
14884 } catch (Exception e) {
14885 System.err.println("Impossible de lire project.properties : " + e.getMessage());
14886 }
14887 strNumVersion = version + "-b" + rbLocalisation.getString("build.numero").replace(" ", "").replace(" ", "");
14888 lisPreferences();
14889 setStPrincipal(stPrimaryStage);
14890 stPrimaryStage.setResizable(false);
14891 // getStPrincipal().setResizable(true); // Désactivé : empêche les problèmes de redimensionnement
14892 getStPrincipal().setAlwaysOnTop(false);
14893 getStPrincipal().setTitle("PanoVisu v" + strNumVersion.split("-")[0]);
14894 stPrimaryStage.setMaximized(true);
14895 stPrimaryStage.setAlwaysOnTop(false);
14896 Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
14897 int iHauteur;
14898 if (isMac()) {
14899 iHauteur = (int) tailleEcran.getHeight() - 60;
14900 } else {
14901 iHauteur = (int) tailleEcran.getHeight() - 20;
14902 }
14903 int iLargeur = (int) tailleEcran.getWidth() - 2;
14904 largeurMax = tailleEcran.getWidth() - 450.0d;
14905 creeEnvironnement(stPrimaryStage, iLargeur, iHauteur);
14906
14907 File fileRepertTempFile = new File(getStrRepertAppli() + File.separator + "temp");
14908 setStrRepertTemp(fileRepertTempFile.getAbsolutePath());
14909
14910 if (!fileRepertTempFile.exists()) {
14911 fileRepertTempFile.mkdirs();
14912 } else {
14913 deleteDirectory(getStrRepertTemp());
14914 }
14915 String strExtTemp = strGenereChaineAleatoire(20);
14916 setStrRepertTemp(getStrRepertTemp() + File.separator + "temp" + strExtTemp);
14917 fileRepertTempFile = new File(getStrRepertTemp());
14918 fileRepertTempFile.mkdirs();
14919 installeEvenements();
14920 projetsNouveau();
14921 stPrimaryStage.setOnCloseRequest((WindowEvent event) -> {
14922 try {
14923 sauvePreferences();
14924 } catch (IOException ex) {
14925 Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
14926 }
14927 ButtonType reponse = null;
14928 ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
14929 ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
14930 ButtonType buttonTypeAnnule = new ButtonType(rbLocalisation.getString("main.annuler"));
14931 if (!isbDejaSauve()) {
14932 Alert alert = new Alert(AlertType.CONFIRMATION);
14933 alert.setTitle(rbLocalisation.getString("main.dialog.quitterApplication"));
14934 alert.setHeaderText(null);
14935 alert.setContentText(rbLocalisation.getString("main.dialog.chargeProjetMessage"));
14936 alert.getButtonTypes().clear();
14937 alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon, buttonTypeAnnule);
14938 Optional<ButtonType> actReponse = alert.showAndWait();
14939 reponse = actReponse.get();
14940 }
14941 if (reponse == buttonTypeOui) {
14942 try {
14943 projetSauve();
14944
14945 } catch (IOException ex) {
14946 Logger.getLogger(EditeurPanovisu.class
14947 .getName()).log(Level.SEVERE, null, ex);
14948 }
14949 }
14950 if ((reponse == buttonTypeOui) || (reponse == buttonTypeNon) || (reponse == null)) {
14951 try {
14952 sauveHistoFichiers();
14953
14954 } catch (IOException ex) {
14955 Logger.getLogger(EditeurPanovisu.class
14956 .getName()).log(Level.SEVERE, null, ex);
14957 }
14958
14959 // Arrêter le serveur HTTP pour libérer le port
14960 try {
14962 System.out.println("✅ Serveur HTTP arrêté lors de la fermeture de l'application");
14963 } catch (Exception ex) {
14964 System.err.println("⚠️ Erreur lors de l'arrêt du serveur HTTP : " + ex.getMessage());
14965 }
14966
14967 deleteDirectory(getStrRepertTemp());
14968 File fileTemp = new File(getStrRepertTemp());
14969 fileTemp.delete();
14970 } else {
14971 event.consume();
14972 }
14973 });
14974 }
14975
14979 private static void afficherDialogueTheme() {
14980 Stage dialogStage = new Stage();
14981 dialogStage.initModality(Modality.APPLICATION_MODAL);
14982 dialogStage.setTitle("Choisir un thème");
14983 dialogStage.setResizable(false);
14984
14985 VBox root = new VBox(10);
14986 root.setPadding(new Insets(15));
14987 root.setAlignment(Pos.TOP_CENTER);
14988
14989 Label lblTitle = new Label("Sélectionnez un thème pour l'application");
14990 lblTitle.setStyle("-fx-font-size: 15px; -fx-font-weight: bold;");
14991
14992 // Container avec ScrollPane pour gérer le débordement
14993 VBox vboxThemes = new VBox(8);
14994 vboxThemes.setPadding(new Insets(5));
14995
14996 // Section thèmes clairs
14997 Label lblLight = new Label("🌞 Thèmes Clairs");
14998 lblLight.setStyle("-fx-font-size: 13px; -fx-font-weight: bold;");
14999 VBox vboxLight = new VBox(5);
15001
15003
15005 RadioButton rb = new RadioButton(theme.getDisplayName());
15006 rb.setToggleGroup(groupThemes);
15007 rb.setUserData(theme);
15008 if (theme == currentTheme) {
15009 rb.setSelected(true);
15010 }
15011 vboxLight.getChildren().add(rb);
15012 }
15013
15014 // Section thèmes sombres
15015 Label lblDark = new Label("🌙 Thèmes Sombres");
15016 lblDark.setStyle("-fx-font-size: 13px; -fx-font-weight: bold;");
15017 VBox vboxDark = new VBox(5);
15018
15020 RadioButton rb = new RadioButton(theme.getDisplayName());
15021 rb.setToggleGroup(groupThemes);
15022 rb.setUserData(theme);
15023 if (theme == currentTheme) {
15024 rb.setSelected(true);
15025 }
15026 vboxDark.getChildren().add(rb);
15027 }
15028
15029 vboxThemes.getChildren().addAll(
15030 lblLight,
15031 vboxLight,
15032 new Separator(),
15033 lblDark,
15034 vboxDark
15035 );
15036
15037 // ScrollPane pour gérer le contenu si la liste est trop longue
15039 scrollPane.setFitToWidth(true);
15040 scrollPane.setPrefHeight(450);
15041 scrollPane.setStyle("-fx-background-color: transparent;");
15042
15043 // Boutons
15044 HBox hboxButtons = new HBox(10);
15045 hboxButtons.setAlignment(Pos.CENTER);
15046 hboxButtons.setPadding(new Insets(10, 0, 0, 0));
15047
15048 Button btnAppliquer = new Button("Appliquer");
15049 btnAppliquer.setOnAction(e -> {
15050 RadioButton selected = (RadioButton) groupThemes.getSelectedToggle();
15051 if (selected != null) {
15053 ThemeManager.applyTheme(getScnPrincipale(), selectedTheme);
15054 System.out.println("✅ Thème changé: " + selectedTheme.getDisplayName());
15055
15056 // Mettre à jour les couleurs des panneaux de hotspots
15057 getGestionnaireInterface().mettreAJourCouleursHotspots();
15058 }
15059 dialogStage.close();
15060 });
15061
15062 Button btnAnnuler = new Button("Annuler");
15063 btnAnnuler.setOnAction(e -> dialogStage.close());
15064
15065 hboxButtons.getChildren().addAll(btnAppliquer, btnAnnuler);
15066
15067 root.getChildren().addAll(
15068 lblTitle,
15069 new Separator(),
15070 scrollPane,
15072 );
15073
15074 Scene scene = new Scene(root, 400, 580); // Réduit à 580px avec ScrollPane
15075 // Appliquer le thème actuel au dialogue
15076 ThemeManager.applyTheme(scene, currentTheme);
15077
15078 dialogStage.setScene(scene);
15079 dialogStage.showAndWait();
15080 }
15081
15103 public static void main(String[] args) {
15104 System.setProperty("file.encoding", "UTF-8");
15105 setStrSystemeExploitation(System.getProperty("os.name"));
15106 launch(args);
15107 }
15108}
OpenLayers Number
Definition OpenLayers.js:61
OpenLayers Geometry Point
OpenLayers String
Definition OpenLayers.js:59
function f
OpenLayers Geometry Polygon
Classe de remplacement pour jfxtras.labs.scene.control.BigDecimalField qui n'est plus disponible dans...
ObjectProperty< BigDecimal > numberProperty()
Obtient la propriété du nombre.
void setNumber(BigDecimal value)
Définit la valeur BigDecimal.
Affichage de la fenêtre de configuration.
Contrôleur pour le dialogue de conversion d'images au ratio 2:1.
double getLongitude()
Retourne la valeur de longitude.
void setLongitude(double longitude)
Définit la valeur de longitude.
void setLatitude(double latitude)
Définit la valeur de latitude.
double getLatitude()
Retourne la valeur de latitude.
void setStrNomDiaporama(String nomDiaporama)
Définit le nom du diaporama.
void setStrFichiersImage(String[] strImages)
Définit le tableau complet des fichiers images.
String[] getStrFichiersImage()
Retourne le tableau complet des fichiers images du diaporama.
void setStrCouleurFondDiaporama(String strCouleurFondDiaporama)
Définit la couleur de fond du diaporama.
int getiNombreImages()
Retourne le nombre d'images dans le diaporama.
String getStrFichierDiaporama()
Retourne le nom du fichier de configuration du diaporama.
String[] getStrLibellesImages()
Retourne le tableau complet des libellés des images.
String getStrCouleurFondDiaporama()
Retourne la couleur de fond du diaporama.
void setDelaiDiaporama(double delaiDiaporama)
Définit le délai d'affichage entre les images.
void setStrLibellesImages(String[] strLibellesImages)
Définit le tableau complet des libellés.
double getDelaiDiaporama()
Retourne le délai d'affichage entre les images.
void setStrFichierDiaporama(String strFichierDiaporama)
Définit le nom du fichier de configuration.
void setStrFichiers(String[] strFichiers)
Définit le tableau complet des noms de fichiers.
String[] getStrFichiers()
Retourne le tableau complet des noms de fichiers.
String getStrNomDiaporama()
Retourne le nom du diaporama.
void setiNombreImages(int iNombreImages)
Définit le nombre d'images dans le diaporama.
double getOpaciteDiaporama()
Retourne l'opacité du fond du diaporama.
void setOpaciteDiaporama(double opaciteDiaporama)
Définit l'opacité du fond du diaporama.
Dialogue pour afficher la documentation au format Markdown.
static void afficher()
Méthode statique pour afficher le dialogue.
définit les ancrages des formes (cercle, rectangle, polygone) pour les barres personnalisées
Editeur de visites virtuelles panoramiques.
static void setStrDernierRepertoireVisite(String aStrDernierRepertoireVisite)
Définit la valeur de strDernierRepertoireVisite.
static Plan[] plans
Tableau des plans du projet.
static String strDernierRepertoireImages
Dernier répertoire utilisé pour le chargement d'images.
static final String[] strHistoFichiers
static String strStyleCSS
Style CSS de l'interface utilisateur.
static AnchorPane apVISU
Elément barre d'outils.
static void panoAjouteHTML(double X, double Y)
static void setScnPrincipale(Scene aScnPrincipale)
Définit la valeur de scnPrincipale.
static void setLocale(Locale aLocale)
Définit la valeur de locale.
static void setApAR(AnchorPane aApAR)
Définit la valeur de apAR.
static ImageView loadSvgIcon(String iconName, int size, javafx.scene.paint.Color color)
Charge une icône SVG avec couleur personnalisée.
static String getStrTooltipStyle()
Retourne la valeur de strTooltipStyle.
static void setiPanoActuel(int aiPanoActuel)
Définit la valeur de iPanoActuel.
static String getStrTypeFichierTransf()
Retourne la valeur de strTypeFichierTransf.
static void panoAjouteDiaporama(double X, double Y)
static void setStrCurrentDir(String aStrCurrentDir)
Définit la valeur de strCurrentDir.
static int getiNombrePlans()
Retourne la valeur de iNombrePlans.
static double getNiveauNetteteTransf()
Retourne la valeur de niveauNetteteTransf.
static String strListePano()
Retourne la liste des panoramiques sous forme de chaine séparés par des points virgule.
static ImageView loadSvgIcon(String iconName, int width, int height, javafx.scene.paint.Color color)
Charge une icône SVG avec dimensions rectangulaires personnalisées.
static MenuItem mniRedimensionnerImages
MenuItem pour l'outil de redimensionnement et compression d'images Permet de traiter des images par l...
static AnchorPane getApDESCIA()
Retourne la valeur de apDESCIA.
static Tab getTabPlan()
Retourne la valeur de tabPlan.
static void setStrRepertTemp(String aStrRepertTemp)
Définit la valeur de strRepertTemp.
static String strDecodeFichier(String strFichier)
static void setStrRepertoireProjet(String aStrRepertoireProjet)
Définit la valeur de strRepertoireProjet.
static void setGestionnaireInterface(GestionnaireInterfaceController aGestionnaireInterface)
Définit la valeur de gestionnaireInterface.
static void setGestionnairePlan(GestionnairePlanController aGestionnairePlan)
Définit la valeur de gestionnairePlan.
static int iCreeNiveauxImageEqui(String strFichierImage, String strNomFichierSauvegarde, String strRepertoire, int iNumPanoXML, int iNumero, int iTotal)
static void setApDESCIA(AnchorPane aApDESCIA)
Définit la valeur de apDESCIA.
static void setApGEO(AnchorPane aApGEO)
Définit la valeur de apGEO.
static void reinitialiserProjet()
Réinitialise complètement toutes les données du projet.
static void setAfficheLoupe(boolean aAfficheLoupe)
Définit la valeur de afficheLoupe.
static void main(String[] args)
Point d'entrée principal de l'application.
static AnchorPane apGEO
Elément barre d'outils.
static void afficheBarrePersonnalisee(int iLargeur, int iHauteur, boolean bMasqueZones)
static void setLargeurE2C(double aLargeurE2C)
Définit la valeur de largeurE2C.
void start(Stage stPrimaryStage)
Méthode de démarrage de l'application JavaFX.
static AnchorPane apHS
Elément barre d'outils.
static int getiNumPoints()
Retourne la valeur de iNumPoints.
static void setStPrincipal(Stage aStPrincipal)
Définit la valeur de stPrincipal.
static int getiNumDiapo()
Retourne la valeur de iNumDiapo.
static String strCurrentDir
Répertoire courant de l'application.
static void genererDescriptionIA(TextArea taDescriptionIA)
Génère une description IA pour le panoramique courant.
static void generateVisitFilesInTemp()
Méthode temporaire - génère les fichiers de visite dans le répertoire temp TODO: Refactoriser pour ex...
static double getHauteurE2C()
Retourne la valeur de hauteurE2C.
static final ComboBox cbListeChoixPanoramique
static void setbPetitePlaneteDemarrage(boolean abPetitePlaneteDemarrage)
Définit la valeur de bPetitePlaneteDemarrage.
static String getStrStyleCSS()
Retourne la valeur de strStyleCSS.
static void setApPPAN(AnchorPane aApPPAN)
Définit la valeur de apPPAN.
static void addDirectoryToZip(File rootDir, File sourceDir, ZipOutputStream zos)
Ajoute récursivement un répertoire au ZIP.
static void setMniAffichagePlan(MenuItem aMniAffichagePlan)
Définit la valeur de mniAffichagePlan.
static AnchorPane apDESCIA
Elément barre d'outils - Description IA.
static void setStrRepertHSImages(String aStrRepertHSImages)
Définit la valeur de strRepertHSImages.
static void setbAutoRotationDemarre(boolean abAutoRotationDemarre)
Définit la valeur de bAutoRotationDemarre.
void creeEnvironnement(Stage stPrimaryStage)
static String getStrBingAPIKey()
Retourne la valeur de strBingAPIKey.
static void setStrPanoListeVignette(String aStrPanoListeVignette)
Définit la valeur de strPanoListeVignette.
static void setTabPlan(Tab aTabPlan)
Définit la valeur de tabPlan.
static int getiNumImages()
Retourne la valeur de iNumImages.
static String getStrAutoTourType()
Retourne la valeur de strAutoTourType.
static String sauvegardeIconeHotspot(Image image, String prefixe, int index, int numPano)
Sauvegarde une image de hotspot dans le répertoire temp et retourne le nom du fichier.
static void setiDecalageMac(int aiDecalageMac)
Définit la valeur de iDecalageMac.
static String sauvegardeIconeHotspot(WritableImage imageColoree, String prefixe, int index, int numPano)
Sauvegarde une image de hotspot colorée dans le répertoire temp et retourne le nom du fichier.
String strGenereChaineAleatoire(int iNombre)
static void rechargerIcones()
Recharge toutes les icônes SVG de la barre d'outils.
static void panoChoixRegard(double X, double Y)
static AnchorPane getApHS()
Retourne la valeur de apHS.
static void setbInternet(boolean abInternet)
Définit la valeur de bInternet.
static void setiNombrePanoramiquesFichier(int aiNombrePanoramiquesFichier)
Définit la valeur de iNombrePanoramiquesFichier.
static int getiAutoRotationVitesse()
Retourne la valeur de iAutoRotationVitesse.
static int getiAutoTourDemarrage()
Retourne la valeur de iAutoTourDemarrage.
static String getStrDernierRepertoireImages()
Retourne la valeur de strDernierRepertoireImages.
static Image imgTransformationImage(Image imgRect, int iRapport)
static ImageView getIvAjouterPlan()
Retourne la valeur de ivAjouterPlan.
static AnchorPane getApGEO()
Retourne la valeur de apGEO.
static String[] getStrCodesLanguesTraduction()
Retourne la valeur de strCodesLanguesTraduction.
static void ajoutePanoramiqueProjet(String strFichierPano, String typePano, int iNumero, int iTotal)
static void setApPVIS(AnchorPane aApPVIS)
Définit la valeur de apPVIS.
static VBox getVbChoixPanoramique()
Retourne la valeur de vbChoixPanoramique.
static AnchorPane apAfficherListePanosVignettes(int iNumHS)
static final String[] strLanguesTraduction
Noms des langues affichés dans l'interface.
static boolean isbPetitePlaneteDemarrage()
Retourne la valeur de bPetitePlaneteDemarrage.
static Task tskChargeListeFichiers(final File[] listFichiers, int iNb)
static String suprimeEspaceFin(String strChaine)
static void setTabInterface(Tab aTabInterface)
Définit la valeur de tabInterface.
static void setStrTypeFichierTransf(String aStrTypeFichierTransf)
Définit la valeur de strTypeFichierTransf.
static void setbNetteteTransf(boolean abNetteteTransf)
Définit la valeur de bNetteteTransf.
static void setMniAjouterPlan(MenuItem aMniAjouterPlan)
Définit la valeur de mniAjouterPlan.
static int getiAutoTourLimite()
Retourne la valeur de iAutoTourVitesse.
static int getiNombreDiapo()
Retourne la valeur de iNombreDiapo.
static void setStrRepertPanos(String aStrRepertPanos)
Définit la valeur de strRepertPanos.
static GestionnairePlanController gestionnairePlan
static PaneOutil getPoGeolocalisation()
Retourne la valeur de poGeolocalisation.
static void setbDejaSauve(boolean abDejaSauve)
Définit la valeur de bDejaSauve.
static String getStrDernierRepertoireVisite()
Retourne la valeur de strDernierRepertoireVisite.
static void ajouterZone(int iLargeur, int iHauteur, boolean bMasqueZones)
static BigDecimalField bdfAutoTourLimite
static String getStrRepertoireProjet()
Retourne la valeur de strRepertoireProjet.
static AnchorPane apPPAN
Elément barre d'outils.
static void afficheHSImage(int i, double longitude, double latitude)
static ImageView ivRedimensionnerImages
ImageView pour l'icône de l'outil de redimensionnement et compression d'images dans la barre d'outils...
static AnchorPane getApPVIS()
Retourne la valeur de apPVIS.
static void setStrAutoTourType(String aStrAutoTourType)
Définit la valeur de strAutoTourType.
static void projetChargeNom(String strNomFich)
static ObservableList< AncreForme > olCreeAncresPourPolygone(int iNumZone, final ObservableList< Double > points)
static void setApAttends(AnchorPane apAttends1)
Définit la valeur de apAttends.
static void creerZipFromDirectory(File sourceDir, File zipFile)
Crée un fichier ZIP à partir d'un répertoire.
static final String[] strCodesLanguesTraduction
Codes des langues supportées pour la traduction.
static ImageView ivConvertirRatio2to1
ImageView pour l'icône de l'outil de conversion au ratio 2:1 dans la barre d'outils.
static Plan[] getPlans()
Retourne la valeur de plans.
static void setStrRepertAppli(String aStrRepertAppli)
Définit la valeur de strRepertAppli.
static String strRepertTemp
Répertoire temporaire de travail.
static MenuItem getMniAffichagePlan()
Retourne la valeur de mniAffichagePlan.
static void rafraichitListePano()
Rafraîchit la liste des panoramiques dans l'interface utilisateur.
static AnchorPane apAR
Elément barre d'outils.
static void setiNumImages(int aiNumImages)
Définit la valeur de iNumImages.
static void deleteDirectory(String strEmplacement)
Supprime récursivement un répertoire et tout son contenu.
static ImageView loadSvgIcon(String iconName, int size)
Charge une icône SVG avec la taille spécifiée.
static void setStrDernierRepertoireImages(String aStrDernierRepertoireImages)
Définit la valeur de strDernierRepertoireImages.
static ResourceBundle rbLocalisation
Bundle de ressources pour la localisation.
static String strRepertAppli
Répertoire d'installation de l'application.
static void setiNumDiapo(int aiNumDiapo)
Définit la valeur de iNumDiapo.
static int iNumHTML
Compteur de fichiers HTML générés.
static AnchorPane getApAttends()
Retourne la valeur de apAttends.
static int iCreeNiveauxImageCube(String strFichierImage, String strRepertoire, int iNumPanoXML, String strFace)
static String[] getStrLanguesTraduction()
Retourne la valeur de strLanguesTraduction.
static void creeEnvironnement(Stage stPrimaryStage, int iLargeur, int iHauteur)
static Task tskAnalyseFichierPVU(final String strLigComplete)
static int iNombrePanoramiques
Nombre total de panoramiques dans le projet.
static AnchorPane getApAR()
Retourne la valeur de apAR.
static int getiTailleLoupe()
Retourne la valeur de iTailleLoupe.
static void ouvrirOutilRedimensionnementImages()
Ouvre l'interface de l'outil de redimensionnement et compression d'images.
static void setiNombrePlans(int aiNombrePlans)
Définit la valeur de iNombrePlans.
static void copieFichierRepertoire(String strFichier, String strRepertoire)
Copie un fichier unique vers un répertoire de destination.
static NavigateurPanoramique navigateurPanoramique
static Locale getLocale()
Retourne la valeur de locale.
static void panoMouseClic(double X, double Y)
static String getStrRepertTemp()
Retourne la valeur de strRepertTemp.
static void genereVisite()
Génère la visite virtuelle HTML complète.
static Panoramique[] getPanoramiquesProjet()
Retourne la valeur de panoramiquesProjet.
static NavigateurOpenLayers navigateurOpenLayers
static String strEncodeFichier(String strFichier)
static void setNiveauNetteteTransf(double aNiveauNetteteTransf)
Définit la valeur de niveauNetteteTransf.
static void setiNombreDiapo(int aiNombreDiapo)
Définit la valeur de iNombreDiapo.
static ObservableList< AncreForme > olCreeAncresPourCercle(int iNumZone, Circle cercle)
static int iNombrePanoramiquesFichier
Nombre de fichiers panoramiques chargés.
static void choixZone(int iLargeur, int iHauteur, boolean bMasqueZones, String strIdZone, MouseEvent mouseEvent)
static double getLargeurE2C()
Retourne la valeur de largeurE2C.
static String strRepertoireProjet
Répertoire de sauvegarde du projet courant.
static void setHauteurE2C(double aHauteurE2C)
Définit la valeur de hauteurE2C.
static void setbAutoTourDemarre(boolean abAutoTourDemarre)
Définit la valeur de bAutoTourDemarre.
static ObservableList< AncreForme > olCreeAncresPourRectangle(int iNumZone, Rectangle rect)
static Tab getTabInterface()
Retourne la valeur de tabInterface.
static void creerZipVisite()
Crée un fichier ZIP contenant la visite virtuelle.
static AnchorPane apPVIS
Elément barre d'outils.
static void setStrSystemeExploitation(String aStrSystemeExploitation)
Définit la valeur de strSystemeExploitation.
static boolean isAfficheLoupe()
Retourne la valeur de afficheLoupe.
static boolean isbInternet()
Retourne la valeur de bInternet.
static void afficheHS(int i, double longitude, double latitude)
static void sauvePreferences()
Sauvegarde les préférences de l'application dans le fichier preferences.cfg.
static void setiTailleLoupe(int aiTailleLoupe)
Définit la valeur de iTailleLoupe.
static PopUpDialogController popUp
static void creerZipDepuisTemp()
Crée un fichier ZIP contenant la visite virtuelle depuis le répertoire temporaire.
static Scene getScnPrincipale()
Retourne la valeur de scnPrincipale.
static void gereSourisPanoramique(MouseEvent mouseEvent)
static boolean isbAutoTourDemarre()
Retourne la valeur de bAutoTourDemarre.
static final OrdrePanoramique ordPano
static void reconstruireIconeHotspot(Object hotspot, int numPano, int index, String prefixe, String nomFichierIconeDefaut)
Reconstruit une icône de hotspot colorée lors du chargement d'un projet.
static void copieRepertoire(String strEmplacement, String strRepertoire)
Copie récursivement un répertoire et tout son contenu vers une destination.
static final String[] strTouchesBarre
static int iNumDiapo
Compteur de diaporamas.
static void afficheNord(double longitude)
static void affichePoV(double longitude, double latitude, double fov)
Affiche la croix représentant le point de vue.
static void setbIntroPetitePlanete(boolean abIntroPetitePlanete)
Définit la valeur de bIntroPetitePlanete.
static void affichePanoChoisit(int iNumPanochoisi)
static void afficheHSDiapo(int i, double longitude, double latitude)
static Locale locale
Locale de l'application.
static void setPanoramiquesProjet(Panoramique[] aPanoramiquesProjet)
Définit la valeur de panoramiquesProjet.
static void afficheLoupe(double x, double y)
static int getiNumHTML()
Retourne la valeur de iNumHTML.
static void setApVISU(AnchorPane aApVISU)
Définit la valeur de apVISU.
static void creerEditerBarre(String strNomFichierBarre)
static void setApHS(AnchorPane aApHS)
Définit la valeur de apHS.
static String strRepertPanos
Répertoire des images panoramiques.
static String getStrPanoListeVignette()
Retourne la valeur de strPanoListeVignette.
static void setStrStyleCSS(String aStrStyleCSS)
Définit la valeur de strStyleCSS.
static String strRepertHSImages
Répertoire des images des hotspots.
static void creeMenu(VBox vbRacine)
static int getiDecalageMac()
Retourne la valeur de iDecalageMac.
static final AnchorPane apVisuPanoramique
static String getStrRepertHSImages()
Retourne la valeur de strRepertHSImages.
static BigDecimalField bdfAutoTourDemarrage
static void setVbChoixPanoramique(VBox aVbChoixPanoramique)
Définit la valeur de vbChoixPanoramique.
static Stage getStPrincipal()
Retourne la valeur de stPrincipal.
static void setPoGeolocalisation(PaneOutil aPoGeolocalisation)
Définit la valeur de poGeolocalisation.
static void setiAutoRotationVitesse(int aiAutoRotationVitesse)
Définit la valeur de iAutoRotationVitesse.
static int getiNombrePanoramiquesFichier()
Retourne la valeur de iNombrePanoramiquesFichier.
static void genereVisite(boolean isZip)
static void setiNombrePanoramiques(int aiNombrePanoramiques)
Définit la valeur de iNombrePanoramiques.
static WritableImage transformerCouleurHotspot(Image imageSource, double couleurFinale, double sat, double bright)
Applique une transformation de couleur à une image de hotspot.
static void setIvAjouterPlan(ImageView aIvAjouterPlan)
Définit la valeur de ivAjouterPlan.
static void setiAutoTourDemarrage(int aiAutoTourDemarrage)
Définit la valeur de iAutoTourDemarrage.
static boolean isbNetteteTransf()
Retourne la valeur de bNetteteTransf.
static final AnchorPane apWebview
static AnchorPane getApPPAN()
Retourne la valeur de apPPAN.
static MenuItem mniConvertirRatio2to1
MenuItem pour l'outil de conversion des images au ratio 2:1 Convertit des images au format panoramiqu...
static void afficherDialogueTheme()
Affiche le dialogue de sélection de thème.
static int getiNombrePanoramiques()
Retourne la valeur de iNombrePanoramiques.
static void ouvrirOutilConversionRatio2to1()
Ouvre l'interface de l'outil de conversion des images au ratio 2:1.
static String getStrCurrentDir()
Retourne la valeur de strCurrentDir.
static void setStrBingAPIKey(String strBingAPIKey1)
static void creerEditerDiaporama(String strDiaporama)
static GestionnairePlanController getGestionnairePlan()
Retourne la valeur de gestionnairePlan.
static boolean isbDejaSauve()
Retourne la valeur de bDejaSauve.
static GestionnaireInterfaceController getGestionnaireInterface()
Retourne la valeur de gestionnaireInterface.
static String getStrSystemeExploitation()
Retourne la valeur de strSystemeExploitation.
static MenuItem getMniAjouterPlan()
Retourne la valeur de mniAjouterPlan.
static void setiAutoTourLimite(int aiAutoTourLimite)
Définit la valeur de iAutoTourVitesse.
static boolean netIsAvailable()
Vérifie la disponibilité de la connexion Internet.
static GestionnaireDiaporamaController gestDiapo
static String getStrRepertAppli()
Retourne la valeur de strRepertAppli.
static final ZoneTelecommande[] zones
static GestionnaireInterfaceController gestionnaireInterface
static void panoAjouteImage(double X, double Y)
static AnchorPane getApVISU()
Retourne la valeur de apVISU.
static void setiNumPoints(int aiNumPoints)
Définit la valeur de iNumPoints.
static void ajouteFichierHisto(String nomFich)
static boolean isbIntroPetitePlanete()
Retourne la valeur de bIntroPetitePlanete.
static String strDernierRepertoireVisite
Dernier répertoire utilisé pour la génération de visite.
static int getiPanoActuel()
Retourne la valeur de iPanoActuel.
static File fileRepertConfig
Fichier de configuration de l'application.
static void creeDiaporamaHTML(Diaporama diapo, int iNumero)
static boolean isbAutoRotationDemarre()
Retourne la valeur de bAutoRotationDemarre.
static void setPlans(Plan[] aPlans)
Définit la valeur de plans.
static void afficheHSHTML(int i, double longitude, double latitude)
static String getStrRepertPanos()
Retourne la valeur de strRepertPanos.
static void rafraichitAffichageHotSpots()
Rafraîchit l'affichage des hotspots dans le panneau de visite Utilisé notamment après l'application d...
static Pane paneAffichageHS(String strLstPano, int iNumPano)
static Panoramique[] panoramiquesProjet
Tableau des panoramiques du projet.
static void setiNumHTML(int aiNumHTML)
Définit la valeur de iNumHTML.
static BigDecimalField bdfAutoRotationVitesse
Controleur pour l'affichage des transformations cube / Equi.
static final String EQUI2CUBE
Constante de type de transfrormation Equi / Cube.
static final String CUBE2QUI
Constante de type de transfrormation Cube / Equi.
Gestion de l'interface de visualition de la visite virtuelle.
String strPoliceInfoBulle
Police utilisée pour les infobulles.
String getStrFenetreURL()
Retourne la valeur de strFenetreURL.
double getOffsetXComboMenu()
Retourne la valeur de offsetXComboMenu.
String getStrPositionBarreClassique()
Retourne la position de la barre classique.
double getFenetreInfoTaille()
Retourne la valeur de fenetreInfoTaille.
String getStrAideBarrePersonnalisee()
Obtient la zone de la barre personnalisée affectée au bouton d'aide.
boolean isbAffichePrecSuivMC()
Retourne la valeur de bAffichePrecSuivMC.
String getStrVisibiliteBarreClassique()
Retourne le mode de visibilité de la barre classique.
String getStrCouleurLigneRadar()
Retourne la valeur de strCouleurLigneRadar.
Color getCouleurFondPlan()
Retourne la valeur de couleurFondPlan.
double getFenetreInfoOpacite()
Retourne la valeur de fenetreInfoOpacite.
boolean isbMasqueVignettes()
Indique si le masque masque les vignettes.
String getStrNomLayers()
Retourne la valeur de strNomLayers.
double getOffsetYBoutonVisiteAuto()
Retourne la valeur de offsetYBoutonVisiteAuto.
boolean isbAfficheRadarCarte()
Retourne la valeur de bAfficheRadarCarte.
int getiNombreZonesBarrePersonnalisee()
Retourne le nombre de zones cliquables de la barre personnalisée.
double getOpaciteReseauxSociaux()
Retourne l'opacité des boutons de réseaux sociaux.
double getTailleReseauxSociaux()
Retourne la taille des boutons de réseaux sociaux.
Color getCouleurFondTheme()
Retourne la valeur de couleurFondTheme.
String getStrZoomBarreClassique()
Indique si le zoom est affiché dans la barre classique.
String getStrCouleurFondRadar()
Retourne la valeur de strCouleurFondRadar.
boolean isbMasqueHotspots()
Retourne la valeur de bMasqueHotspots.
String getStrFenetreURLCouleur()
Retourne la valeur de strFenetreURLCouleur.
boolean isbAiguilleMobileBoussole()
Indique si l'aiguille de la boussole doit tourner avec la vue.
double getFenetreAideOpacite()
Retourne la valeur de fenetreAideOpacite.
boolean isbReseauxSociauxMeta()
Retourne la valeur de bReseauxSociauxMeta.
static String strNomfichierHSImage
Nom du fichier du hotspot image sélectionné.
boolean isbAfficheComboMenu()
Retourne la valeur de bAfficheComboMenu.
String getStrFenetreInfoImage()
Retourne la valeur de strFenetreInfoImage.
double getOffsetXBarrePersonnalisee()
Retourne la valeur de offsetXBarrePersonnalisee.
boolean isbAfficheVignettes()
Indique si les vignettes de navigation sont affichées.
double getOffsetYBarreClassique()
Retourne le décalage vertical de la barre classique.
int getiCalqueVisiteAuto()
Retourne la valeur de iCalqueVisiteAuto.
String getStrVisibiliteBarrePersonnalisee()
Obtient la zone de la barre personnalisée affectée au bouton de visibilité.
boolean isbTitrePanoramique()
Retourne la valeur de bTitrePanoramique.
boolean isbMasqueTitre()
Indique si le masque masque le titre.
boolean isbMasqueBoussole()
Indique si le masque masque la boussole.
double getOffsetXBoussole()
Retourne le décalage horizontal de la boussole par rapport à sa position de référence.
String getStrInfoBarrePersonnalisee()
Obtient la zone de la barre personnalisée affectée au bouton d'information.
String strCouleurFondInfoBulle
Couleur de fond des infobulles au format hexadécimal.
static String strTypeHS
Type du hotspot sélectionné (navigation, image, HTML).
static String strNomfichierHS
Nom du fichier du hotspot de navigation sélectionné.
double getdXReseauxSociaux()
Retourne le décalage horizontal des réseaux sociaux par rapport à leur position de référence.
int iArrondiTL
Rayons d'arrondi des coins des infobulles (TL=TopLeft, TR=TopRight, BL=BottomLeft,...
String getStrPleinEcranBarrePersonnalisee()
Obtient la zone de la barre personnalisée affectée au bouton plein écran.
double getFenetreAidePosY()
Retourne la valeur de fenetreAidePosY.
String getStrCouleurTitre()
Obtient la couleur du texte du titre du panoramique.
void afficheTemplate()
Affiche l'interface selon le template actuel.
void rafraichit()
Rafraîchit l'affichage complet de l'interface utilisateur.
boolean isbMasquePlan()
Indique si le masque masque le plan.
String getStrPositionXComboMenu()
Retourne la valeur de strPositionXComboMenu.
String getStrTitrePoliceNom()
Retourne la valeur de strTitrePoliceNom.
String getStrCouleurTexteCarte()
Retourne la valeur de strCouleurTexteCarte.
double getdXMasque()
Retourne le décalage horizontal du masque par rapport à sa position de référence.
String getStrImageBoussole()
Retourne le nom du fichier image de la boussole utilisée.
double getOffsetXBoutonVisiteAuto()
Retourne la valeur de offsetXBoutonVisiteAuto.
double getOpaciteCarte()
Retourne la valeur de opaciteCarte.
String strCouleurBordureInfoBulle
Couleur de la bordure des infobulles au format hexadécimal.
boolean isbAfficheRadar()
Retourne la valeur de bAfficheRadar.
String getStrSourisBarreClassique()
Indique si le mode souris est affiché dans la barre classique.
String getStrPositionCarte()
Retourne la valeur de strPositionCarte.
String getStrFenetreTexteURL()
Retourne la valeur de strFenetreTexteURL.
String getStrPleinEcranBarreClassique()
Indique si le plein écran est affiché dans la barre classique.
int getiCalqueBarreClassique()
Retourne la valeur de iCalqueBarreClassique.
String getStrRotationBarrePersonnalisee()
Obtient la zone de la barre personnalisée affectée aux boutons de rotation.
int getiCalqueBoussole()
Retourne la valeur de iCalqueBoussole.
String getStrOutilsBarreClassique()
Indique si les outils sont affichés dans la barre classique.
double getOffsetXBarreClassique()
Retourne le décalage horizontal de la barre classique.
boolean isbAffichePersMC2()
Retourne la valeur de bAffichePersMC2.
boolean isbTitreAdapte()
Retourne la valeur de bTitreAdapte.
String getStrPositionXBoutonVisiteAuto()
Retourne la valeur de strPositionXBoutonVisiteAuto.
ZoneTelecommande[] getZonesBarrePersonnalisee()
Retourne la valeur de zonesBarrePersonnalisee.
boolean isbMasqueNavigation()
Indique si le masque masque la barre de navigation.
int getiNombreImagesBouton()
Retourne la valeur de iNombreImagesBouton.
boolean isbReseauxSociauxEmail()
Retourne la valeur de bReseauxSociauxEmail.
int getiNombreImagesFond()
Retourne la valeur de iNombreImagesFond.
boolean isbAfficheBoutonVisiteAuto()
Retourne la valeur de bAfficheBoutonVisiteAuto.
double getOpaciteVignettes()
Retourne l'opacité des vignettes.
double getHauteurCarte()
Retourne la valeur de hauteurCarte.
ImageFond[] getImagesFond()
Retourne la valeur de imagesFond.
boolean isbAffichePersMC1()
Retourne la valeur de bAffichePersMC1.
static String strTypeHSHTML
Type du hotspot HTML sélectionné.
void mettreAJourCouleursHotspots()
Met à jour les couleurs de fond des panneaux d'icônes de hotspots selon le thème actuel (clair ou som...
String getStrLien2BarrePersonnalisee()
Obtient le second lien associé à la barre personnalisée.
boolean isbAfficheTitre()
Retourne la valeur de bAfficheTitre.
double getTailleImageVignettes()
Retourne la taille des images dans les vignettes.
int getiFacteurZoomCarte()
Retourne la valeur de iFacteurZoomCarte.
int getiTailleHotspotsHTML()
Retourne la valeur de iTailleHotspotsHTML.
String getStrPositionYComboMenu()
Retourne la valeur de strPositionYComboMenu.
String getStrCouleurFondRadarCarte()
Retourne la valeur de strCouleurFondRadarCarte.
WritableImage[] getWiNouveauxBoutons()
Retourne la valeur de wiNouveauxBoutons.
String getStrSourisBarrePersonnalisee()
Obtient la zone de la barre personnalisée affectée au bouton de la souris.
String getStrCouleurTextePlan()
Retourne la valeur de strCouleurTextePlan.
boolean isbMasqueCombo()
Indique si le masque masque le menu déroulant (combo).
double getOpaciteTheme()
Retourne la valeur de opaciteTheme.
static String strNomfichierHSHTML
Nom du fichier du hotspot HTML sélectionné.
double getOpaciteBoussole()
Retourne l'opacité de la boussole.
double getOpaciteBarrePersonnalisee()
Obtient l'opacité de la barre de navigation personnalisée.
String getStrPositionPlan()
Retourne la valeur de strPositionPlan.
double getOffsetYBarrePersonnalisee()
Retourne la valeur de offsetYBarrePersonnalisee.
CoordonneesGeographiques getCoordCentreCarte()
Retourne la valeur de coordCentreCarte.
boolean isbAfficheMasque()
Indique si le masque est affiché dans la visualisation.
Color getCouleurFondCarte()
Retourne la valeur de couleurFondCarte.
double getdYReseauxSociaux()
Retourne le décalage vertical des réseaux sociaux par rapport à leur position de référence.
double getFenetreAideTaille()
Retourne la valeur de fenetreAideTaille.
String getStrPositionVignettes()
Retourne la position des vignettes dans l'interface.
String getStrCouleurFondVignettes()
Retourne la couleur de fond des vignettes au format hexadécimal.
String getStrFenetreAideImage()
Retourne la valeur de strFenetreAideImage.
String getStrTitrePosition()
Retourne la valeur de strTitrePosition.
String strCouleurTexteInfoBulle
Couleur du texte des infobulles au format hexadécimal.
String strGetTemplate()
Retourne le template d'interface actuellement sélectionné
WritableImage getWiBarrePersonnaliseeCouleur()
Obtient l'image de la barre personnalisée avec les couleurs appliquées.
int getiCalqueVignettes()
Retourne la valeur de iCalqueVignettes.
int getiCalqueSuivPrec()
Retourne la valeur de iCalqueSuivPrec.
int iTailleBordureTop
Épaisseurs des bordures des infobulles (top, bottom, left, right) en pixels.
NavigateurCarte navigateurCarteOL
Navigateur de carte OpenLayers.
double getTailleBoussole()
Retourne la taille de la boussole en pixels.
double getOffsetYComboMenu()
Retourne la valeur de offsetYComboMenu.
String getStrRotationBarreClassique()
Indique si la rotation est affichée dans la barre classique.
int getiCalqueMenuPanoramiques()
Retourne la valeur de iCalqueMenuPanoramiques.
double getdYMasque()
Retourne le décalage vertical du masque par rapport à sa position de référence.
boolean isbReseauxSociauxTwitter()
Retourne la valeur de bReseauxSociauxTwitter.
int getiTailleHotspotsImage()
Retourne la valeur de iTailleHotspotsImage.
static String strTypeHSImage
Type du hotspot image sélectionné.
double getFenetreAidePosX()
Retourne la valeur de fenetreAidePosX.
double getOffsetYBoussole()
Retourne le décalage vertical de la boussole par rapport à sa position de référence.
String getStrCouleurTexteVignettes()
Retourne la couleur du texte des vignettes au format hexadécimal.
String getStrPositionReseauxSociaux()
Retourne la position des boutons de réseaux sociaux dans l'interface.
String getStrPositionMasque()
Retourne la position du masque dans l'interface.
int getiCalqueMasquage()
Retourne la valeur de iCalqueMasquage.
double getTailleIconesBarrePersonnalisee()
Obtient la taille des icônes affichées dans la barre personnalisée.
String getStrCouleurLigneRadarCarte()
Retourne la valeur de strCouleurLigneRadarCarte.
int getiTailleHotspotsPanoramique()
Retourne la valeur de iTailleHotspotsPanoramique.
void setTemplate(List< String > strTemplate)
Applique un template d'interface à partir d'une liste de paramètres.
double getTailleBarrePersonnalisee()
Obtient la taille (hauteur) de la barre de navigation personnalisée en pixels.
double getLargeurCarte()
Retourne la valeur de largeurCarte.
boolean isbMasqueReseaux()
Indique si le masque masque les réseaux sociaux.
double getTailleBoutonVisiteAuto()
Retourne la valeur de tailleBoutonVisiteAuto.
double getTitreOpacite()
Obtient l'opacité du fond du titre du panoramique.
double taillePoliceInfoBulle
Taille de la police des infobulles en points.
boolean isbMasqueSuivPrec()
Retourne la valeur de bMasqueSuivPrec.
boolean isbAffichePlanetNormalMC()
Retourne la valeur de bAffichePlanetNormalMC.
String getStrLien1BarrePersonnalisee()
Obtient le chemin vers le fichier SHP (shapefile) définissant les zones de la barre.
void setiNombreImagesFond(int iNombreImagesFond)
Définit la valeur de iNombreImagesFond.
double getTailleMasque()
Retourne la taille du masque en pixels.
String getStrPositionBoussole()
Retourne la position de la boussole dans l'interface.
String getStrDeplacementsBarreClassique()
Indique si les déplacements sont affichés dans la barre classique.
String getStrPositionBarrePersonnalisee()
Obtient la position de la barre de navigation personnalisée sur l'écran.
String[] getStrNomImagesBoutons()
Retourne la valeur de strNomImagesBoutons.
int getiCalqueBarrePersonnalisee()
Retourne la valeur de iCalqueBarrePersonnalisée.
String getStrPositionYBoutonVisiteAuto()
Retourne la valeur de strPositionYBoutonVisiteAuto.
void ajouterPlan()
Ajoute un nouveau plan à la liste des plans disponibles.
void setiPlanActuel(int iPlanActuel)
Définit la valeur de iPlanActuel.
AnchorPane getApPlan()
Retourne la valeur de apPlan.
Pane getPaneInterface()
Retourne le panneau d'interface principal.
Label getLblDragDropPlan()
Retourne le label d'indication de drag & drop pour le plan.
ScrollPane getSpOutils()
Retourne la valeur de spOutils.
Définition des hotspots panoramiques.
Definition HotSpot.java:15
void setStrCouleurPerso(String strCouleurPerso)
Définit la couleur personnalisée du hotspot.
Definition HotSpot.java:355
void setLongitude(Number longitude)
Définit la longitude du hotspot.
Definition HotSpot.java:65
void setStrFichierImage(String strFichierImage)
Définit le fichier image d'icône du hotspot.
Definition HotSpot.java:107
void setStrTypeAnimation(String strTypeAnimation)
Définit le type d'animation du hotspot.
Definition HotSpot.java:203
void setAgranditSurvol(boolean bAgranditSurvol)
Active ou désactive l'agrandissement au survol.
Definition HotSpot.java:225
String getStrCouleurPerso()
Retourne la couleur personnalisée du hotspot.
Definition HotSpot.java:345
Image getImgIconeSource()
Retourne l'image source non colorée de l'icône.
Definition HotSpot.java:365
void setImgIconeSource(Image imgIconeSource)
Définit l'image source non colorée de l'icône.
Definition HotSpot.java:375
String getStrNomIconeSource()
Retourne le nom du fichier icône source original.
Definition HotSpot.java:385
void setChampVisuel(double champVisuel)
Définit le champ visuel cible.
Definition HotSpot.java:313
void setLatitude(Number latitude)
Définit la latitude du hotspot.
Definition HotSpot.java:87
void setStrFichierXML(String strFichierXML)
Définit le fichier XML du panorama cible.
Definition HotSpot.java:129
int getNumeroPano()
Retourne le numéro du panorama cible.
Definition HotSpot.java:237
String getStrFichierImage()
Retourne le chemin du fichier image d'icône du hotspot.
Definition HotSpot.java:97
double getLatitude()
Retourne la latitude du hotspot dans le panorama.
Definition HotSpot.java:77
void setRegardX(double regardX)
Définit la longitude du regard cible.
Definition HotSpot.java:269
String getStrFichierXML()
Retourne le nom du fichier XML du panorama cible.
Definition HotSpot.java:119
double getLongitude()
Retourne la longitude du hotspot dans le panorama.
Definition HotSpot.java:55
void setStrInfo(String strInfo)
Définit le texte d'information du hotspot.
Definition HotSpot.java:151
void setImgVueHs(Image imgVueHs)
Définit l'image de prévisualisation du hotspot.
Definition HotSpot.java:335
void setNumeroPano(int iNumeroPano)
Définit le numéro du panorama cible.
Definition HotSpot.java:247
void setStrNomIconeSource(String strNomIconeSource)
Définit le nom du fichier icône source original.
Definition HotSpot.java:395
void setRegardY(double regardY)
Définit la latitude du regard cible.
Definition HotSpot.java:291
Définition des hotspots Image.
void setStrInfo(String strInfo)
Définit la valeur de strInfo.
void setLongitude(Number longitude)
Définit la valeur de longitude.
int getiNumDiapo()
Retourne la valeur de iNumDiapo.
double getLongitude()
Retourne la valeur de longitude.
double getLatitude()
Retourne la valeur de latitude.
void setbAnime(boolean bAnime)
Définit la valeur de bAnime.
void setiNumDiapo(int iNumDiapo)
Définit la valeur de iNumDiapo.
void setLatitude(Number latitude)
Définit la valeur de latitude.
double getLatitude()
Retourne la valeur de latitude.
String getStrTexteHTML()
Retourne la valeur de strTexteHTML.
void setiNombreImages(int iNombreImages)
Définit la valeur de iNombreImages.
void setStrTypeAnimation(String strTypeAnimation)
void setStrTexteHTML(String strTexteHTML)
Définit la valeur de strTexteHTML.
String getStrCouleurPerso()
Retourne la valeur de couleurPerso.
ImageEditeurHTML[] getImagesEditeur()
Retourne la valeur de imagesEditeur.
void setStrFichierImage(String strFichierImage)
Définit la valeur de strFichierImage.
double getLongitude()
Retourne la valeur de longitude.
void creeHTML(String strPageHTML)
Génère le fichier HTML du hotspot dans le répertoire de destination.
String getStrFichierImage()
Retourne la valeur de strFichierImage.
String getStrNomIconeSource()
Retourne la valeur de strNomIconeSource.
void setStrInfo(String strInfo)
Définit la valeur de info.
void setStrCouleurPerso(String strCouleurPerso)
Définit la valeur de couleurPerso.
void setLatitude(Number latitude)
Définit la valeur de latitude.
void setAgranditSurvol(boolean bAgranditSurvol)
Définit la valeur de agranditSurvol.
void setImgIconeSource(Image imgIconeSource)
Définit la valeur de imgIconeSource.
void setLongitude(Number longitude)
Définit la valeur de longitude.
Définition des hotspots Image.
String getStrLienImg()
Retourne la valeur de fichierXML.
void setStrInfo(String strInfo)
Définit la valeur de info.
String getStrNomIconeSource()
Retourne la valeur de strNomIconeSource.
void setStrCouleurFond(String strCouleurFond)
Définit la valeur de strCouleurFond.
void setStrUrlImage(String strUrlImage)
Définit la valeur de urlImage.
void setStrFichierImage(String strFichierImage)
Définit la valeur de fichierImage.
double getLongitude()
Retourne la valeur de longitude.
void setAgranditSurvol(boolean bAgranditSurvol)
Définit la valeur de agranditSurvol.
String getStrCouleurPerso()
Retourne la valeur de couleurPerso.
String getStrFichierImage()
Retourne la valeur de fichierImage.
String getStrCouleurFond()
Retourne la valeur de strCouleurFond.
void setLatitude(Number latitude)
Définit la valeur de latitude.
void setLongitude(Number longitude)
Définit la valeur de longitude.
void setImgIconeSource(Image imgIconeSource)
Définit la valeur de imgIconeSource.
void setStrTypeAnimation(String strTypeAnimation)
Définit la valeur de typeAnimation.
void setOpacite(double opacite)
Définit la valeur de opacite.
void setStrCouleurPerso(String strCouleurPerso)
Définit la valeur de couleurPerso.
double getLatitude()
Retourne la valeur de latitude.
String getStrUrl()
Retourne la valeur de url.
double getOffsetY()
Retourne la valeur de offsetY.
double getOpacite()
Retourne la valeur de opacite.
boolean isMasquable()
Retourne la valeur de masquable.
String getStrPosY()
Retourne la valeur de posY.
int getTailleX()
Retourne la valeur de tailleX.
String getStrCible()
Retourne la valeur de strCible.
String getStrInfobulle()
Retourne la valeur de infobulle.
String getStrPosX()
Retourne la valeur de posX.
double getOffsetX()
Retourne la valeur de offsetX.
String getStrFichierImage()
Retourne la valeur de fichierImage.
int getiCalqueImage()
Retourne la valeur de iCalqueImage.
int getTailleY()
Retourne la valeur de tailleY.
CoordonneesGeographiques recupereCoordonnees()
Récupère les coordonnées actuelles du centre de la carte.
void setPositNord(double positNord)
Définit la position angulaire du nord géographique.
void setFov(double fov)
Définit le champ de vision (Field of View)
void setChoixLatitude(double choixLatitude)
Définit la latitude choisie pour un hotspot.
void affiche()
Affiche le navigateur panoramique dans l'interface.
double getFov()
Retourne le champ de vision (Field of View) actuel.
double getChoixLatitude()
Retourne la latitude choisie par l'utilisateur pour un hotspot.
Button getBtnPleinEcran()
Retourne le bouton de basculement plein écran.
void setLongitude(double longitude)
Définit la longitude de la vue panoramique.
void setImagePanoramique(String strImagePanoramique, Image imgPanoramique)
Définit l'image panoramique à afficher.
double getLatitude()
Retourne la latitude actuelle de la vue panoramique.
double getMinFov()
Retourne le champ de vision minimum autorisé
double getChoixLongitude()
Retourne la longitude choisie par l'utilisateur pour un hotspot.
void setMaxFov(double maxFov)
Définit le champ de vision maximum autorisé
double getChoixFov()
Retourne le FOV choisi par l'utilisateur pour un hotspot.
double getLongitude()
Retourne la longitude actuelle de la vue panoramique.
void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Ajoute un écouteur de changement de propriété
void setLatitude(double latitude)
Définit la latitude de la vue panoramique.
void setbPleinEcran(boolean bPleinEcran)
Active ou désactive le mode plein écran.
void setChoixFov(double choixFov)
Définit le FOV choisi pour un hotspot.
void setMinFov(double minFov)
Définit le champ de vision minimum autorisé
double getMaxFov()
Retourne le champ de vision maximum autorisé
String getNomFichierPanoramique()
Retourne le nom du fichier image panoramique.
void setChoixLongitude(double choixLongitude)
Définit la longitude choisie pour un hotspot.
AnchorPane affichePano()
Affiche le panorama dans un conteneur AnchorPane.
Service pour interagir avec des API IA (Ollama local ou Hugging Face en ligne) Ollama API: https://gi...
static void setOpenRouterModel(String modelName)
Définit le modèle OpenRouter à utiliser.
static boolean verifierOpenRouterDisponible()
Vérifie si OpenRouter est disponible (token configuré)
static boolean isOllamaAvailable()
Vérifie si un service IA est disponible (Ollama ou Hugging Face)
static String getServiceName()
Retourne le nom du service actuellement utilisé
static void setOllamaModel(String modelName)
Définit le modèle Ollama à utiliser.
static void reinitialiserCacheDescriptions()
Réinitialise le cache des descriptions (à appeler au changement de visite)
static void setForceOllama(boolean force)
Force l'utilisation d'Ollama (mode offline)
static CompletableFuture< String > genererDescription(String titreVisite, String titrePanoramique, String latitude, String longitude, Locale locale)
Génère une description géographique basée sur les informations disponibles IMPORTANT : Tient compte d...
void creeListe()
Crée et initialise la liste ordonnée des panoramiques.
AnchorPane getApListePanoramiques()
Retourne la valeur de apListePanoramiques.
void ajouteNouveauxPanos()
Ajoute les nouveaux panoramiques à la liste.
ObservableList< String > getStrPanos()
Retourne la valeur de strPanos.
ObservableList< PanoramiqueCellule > getCellulesPanoramiques()
Retourne la valeur de cellulesPanoramiques.
AnchorPane getApPaneOutil()
Retourne la valeur de apPaneOutil.
static void deplieReplie(AnchorPane apTitre, ImageView ivBtnPlusTitre)
ImageView getIvBtnPlusOutil()
Retourne la valeur de ivBtnPlusOutil.
AnchorPane getApOutil()
Retourne la valeur de apOutil.
Défintions des vues Panoramiques.
void setHotspotHTML(HotspotHTML hotspot, int i)
Définit la valeur de hotspots.
String getStrDescriptionIA()
Retourne la valeur de strDescriptionIA.
double getRegardY()
Retourne la valeur de lookAtY.
void setStrDescriptionIA(String strDescriptionIA)
Définit la valeur de strDescriptionIA.
int getNombreHotspots()
Retourne la valeur de nombreHotspots.
HotspotImage getHotspotImage(int i)
boolean isAffDescription()
Retourne la valeur de affDescription.
void setHotspotImage(HotspotImage hotspot, int i)
Définit la valeur de hotspots.
void setChampVisuel(double champVisuel)
Définit la valeur de champVisuel.
void setRegardX(double lookAtX)
Définit la valeur de lookAtX.
static final String SPHERE
Constante de type de panoramique : Sphere.
double getChampVisuel()
Retourne la valeur de champVisuel.
boolean isAfficheTitre()
Retourne la valeur de afficheTitre.
void setNumeroPlan(int iNumeroPlan)
Définit la valeur de numeroPlan.
HotspotHTML getHotspotHTML(int i)
void setAfficheTitre(boolean bAfficheTitre)
Définit la valeur de afficheTitre.
void setFovMin(double fovMin)
Définit la valeur de fovMin.
void setbMaxLat(boolean bMaxLat)
Définit la valeur de bMaxLat.
HotspotDiaporama getHotspotDiapo(int i)
void addHotspotDiapo(HotspotDiaporama hotspot)
void setMarqueurGeolocatisation(CoordonneesGeographiques marqueurGeolocatisation)
Définit la valeur de marqueurGeolocatisation.
static final String CUBE
Constante de type de panoramique : Sphere.
boolean isbMinLat()
Retourne la valeur de bMinLat.
int getNumeroPlan()
Retourne la valeur de numeroPlan.
int getNombreHotspotImage()
Retourne la valeur de nombreHotspotImage.
boolean isAfficheInfo()
Retourne la valeur de afficheInfo.
String getStrTitrePanoramique()
Retourne la valeur de titrePanoramique.
void setMinLat(double minLat)
Définit la valeur de minLat.
boolean isbMaxLat()
Retourne la valeur de bMaxLat.
void addHotspotHTML(HotspotHTML hotspot)
void setMaxLat(double maxLat)
Définit la valeur de maxLat.
double getNombreNiveaux()
Retourne la valeur de nombreNiveaux.
void setZeroNord(double zeroNord)
Définit la valeur de zeroNord.
double getMinLat()
Retourne la valeur de minLat.
void setFovMax(double fovMax)
Définit la valeur de fovMax.
void setAfficheInfo(boolean bAfficheInfo)
Définit la valeur de afficheInfo.
void addHotspotImage(HotspotImage hotspot)
String getStrTypePanoramique()
Retourne la valeur de typePanoramique.
String getStrNomFichier()
Retourne la valeur de nomFichier.
int getNombreHotspotHTML()
Retourne la valeur de nombreHotspotHTML.
void setRegardY(double lookAtY)
Définit la valeur de lookAtY.
void addHotspot(HotSpot hotspot)
void setbMinLat(boolean bMinLat)
Définit la valeur de bMinLat.
int getiNombreHotspotDiapo()
Retourne la valeur de iNombreHotspotDiapo.
void setAffDescription(boolean bAffDescription)
Définit la valeur de affDescription.
void setAffichePlan(boolean bAffichePlan)
Définit la valeur de affichePlan.
double getZeroNord()
Retourne la valeur de zeroNord.
Image getImgVisuPanoramique()
Retourne la valeur de imgVisuPanoramique.
void setStrTypePanoramique(String strTypePanoramique)
Définit la valeur de typePanoramique.
boolean isAffichePlan()
Retourne la valeur de affichePlan.
void setStrTitrePanoramique(String strTitrePanoramique)
Définit la valeur de titrePanoramique.
double getRegardX()
Retourne la valeur de lookAtX.
double getFovMax()
Retourne la valeur de fovMax.
CoordonneesGeographiques getMarqueurGeolocatisation()
Retourne la valeur de marqueurGeolocatisation.
double getFovMin()
Retourne la valeur de fovMin.
double getMaxLat()
Retourne la valeur de maxLat.
void setStrImagePlan(String strImagePlan)
Définit la valeur de imagePlan.
Definition Plan.java:248
void setTitrePlan(String strTitrePlan)
Definition Plan.java:80
void setPositionX(double positionX)
Définit la valeur de positionX.
Definition Plan.java:212
void setStrPosition(String strPosition)
Définit la valeur de position.
Definition Plan.java:194
void setPositionY(double positionY)
Définit la valeur de positionY.
Definition Plan.java:230
void addHotspot(HotSpot hotspot)
Definition Plan.java:50
void setDirectionNord(double directionNord)
Définit la valeur de directionNord.
Definition Plan.java:176
void setStrLienPlan(String strLienPlan)
Définit la valeur de lienPlan.
Definition Plan.java:266
void affichePopup()
Affiche la popup d'accueil avec le thème actif.
fonctions de sauvegarde des images
static Image resizeImage(Image img, int newW, int newH)
Redimensionne une image avec accélération GPU.
static void writePng(Image img, String destFile, boolean sharpen, float sharpenLevel)
static Image readTiff(String strNomFich)
static void writeJpeg(Image img, String destFile, float quality, boolean sharpen, float sharpenLevel)
Contrôleur pour l'interface de redimensionnement et compression d'images.
Gestionnaire de thèmes pour l'application EditeurPanovisu.
static Theme loadSavedTheme()
Charge le thème sauvegardé dans les préférences.
static void applyTheme(Scene scene, Theme theme)
Applique un thème à une scène JavaFX.
static Theme[] getDarkThemes()
Retourne les thèmes sombres.
static void applySavedTheme(Scene scene)
Applique le thème sauvegardé à une scène.
static Theme getCurrentTheme()
Retourne le thème actuellement appliqué
static Theme[] getLightThemes()
Retourne les thèmes clairs.
fonctions de transformation des images panoramiques (Cube / Equirectangulaire) Version CPU optimisée ...
static Image cube2rect(Image front, Image left, Image right, Image behind, Image top, Image bottom, int taille)
Transformation cube vers équirectangulaire (version CPU originale)
static Image[] equi2cubeAuto(Image equi, int taille)
Transformation Équirectangulaire vers Cube avec routage automatique GPU/CPU Cette méthode détecte aut...
void setStrIdZone(String strIdZone)
String getStrCoordonneesZone()
Retourne la valeur de strCoordonneesZone.
String getStrTypeZone()
Retourne la valeur de strTypeZone.
void setStrCoordonneesZone(String strCoordonneesZone)
Définit la valeur de strCoordonneesZone.
String getStrIdZone()
Retourne la valeur de strNomZone.
Gestionnaire singleton pour l'accélération GPU via OpenCL Gère la détection, l'initialisation et le c...
static synchronized GPUManager getInstance()
Récupère l'instance unique du gestionnaire GPU.
boolean isGPUEnabled()
Vérifie si l'utilisation du GPU est activée par l'utilisateur.
void setGPUEnabled(boolean enabled)
Active ou désactive l'utilisation du GPU.
Serveur HTTP local simple pour servir les visites virtuelles.
void setRootDirectory(String rootDirectory)
Définit le répertoire racine à servir.
String getUrl()
Obtient l'URL complète du serveur.
void reset()
Réinitialise le serveur (arrête et remet le port à 8080)
static synchronized LocalHTTPServer getInstance()
Obtient l'instance unique du serveur.
void start()
Démarre le serveur HTTP.
void stop()
Arrête le serveur HTTP.
Utilitaire pour charger des icônes SVG et les adapter au thème CSS Les SVG utilisent "currentColor" q...
static void clearCache()
Vide le cache des icônes (utile lors d'un changement de thème)
chainesTraduction[ 'de_DE'] pleinEcran
Definition de_DE.js:20
Liste des thèmes disponibles - organisés par thème clair/sombre.
if(!$.ui||!$.ui.widget)
function root
function x(t, e, i)
Definition leaflet.js:5
function t
Definition leaflet.js:5
function ii(t, e, i)
Definition leaflet.js:5
function k(t, e, i, n)
Definition leaflet.js:5
function i(t, e)
Definition leaflet.js:5
function Y(t)
Definition leaflet.js:5
var X
Definition leaflet.js:5
function y(t)
Definition leaflet.js:5
var e
Definition leaflet.js:5
function me(t)
Definition leaflet.js:5
function p(t, e, i)
Definition leaflet.js:5
var d
Definition leaflet.js:5
function j(t, e, i)
Definition leaflet.js:5
var version
THREE Color
Definition three.min1.js:6
THREE Scene
THREE Line
THREE Math
var log
Definition types.js:70